Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
webapps: update recents and status bar color sooner
Browse files Browse the repository at this point in the history
Currently there is a delay until the native library is loaded for the data
to be updated. There is no reason for this to happen as we have all the
infomation to do so and the native library is not needed to update recents
or the status bar.

Change this so that these items are updated earlier in the initialization
cycle. Moreover, remove an old TODO.

BUG=510402
[email protected]

Review URL: https://codereview.chromium.org/1313063002

Cr-Commit-Position: refs/heads/master@{#345664}
(cherry picked from commit 20e720c)

Review URL: https://codereview.chromium.org/1320863002 .

Cr-Commit-Position: refs/branch-heads/2490@{#45}
Cr-Branched-From: 7790a35-refs/heads/master@{#344925}
  • Loading branch information
mounirlamouri committed Aug 27, 2015
1 parent 7a427ff commit e3f012d
Showing 1 changed file with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ private void initializeUI(Bundle savedInstanceState) {
public void preInflationStartup() {
WebappInfo info = WebappInfo.create(getIntent());
if (info != null) mWebappInfo.copy(info);

updateTaskDescription();

mCleanupTask = new WebappDirectoryManager(getActivityDirectory(),
WEBAPP_SCHEME, FeatureUtilities.isDocumentModeEligible(this));

Expand Down Expand Up @@ -289,14 +292,19 @@ public void onFaviconUpdated(Tab tab) {
}

private void updateTaskDescription() {
// TODO(lalitm): this is actually a temporary fix for the bigger issue of short
// name not being set to the meta tag title of the website if the short name
// is not present in the manifest. Some discussion is required for this before
// a CL which correctly fixes the issue is submitted.
String title = TextUtils.isEmpty(mWebappInfo.shortName())
? getActivityTab().getTitle() : mWebappInfo.shortName();
Bitmap icon = mWebappInfo.icon() == null
? getActivityTab().getFavicon() : mWebappInfo.icon();
String title = null;
if (!TextUtils.isEmpty(mWebappInfo.shortName())) {
title = mWebappInfo.shortName();
} else if (getActivityTab() != null) {
title = getActivityTab().getTitle();
}

Bitmap icon = null;
if (mWebappInfo.icon() != null) {
icon = mWebappInfo.icon();
} else if (getActivityTab() != null) {
icon = getActivityTab().getFavicon();
}

if (mBrandColor == null
&& mWebappInfo.themeColor() != ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING
Expand Down

0 comments on commit e3f012d

Please sign in to comment.