diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-06 03:01:26 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-06 03:01:26 +0000 |
commit | a617deabb4d37584886f61f30b14d9d887dcb0c7 (patch) | |
tree | 3a49dedb58b722af8d9ca460e6eec3e784a5177f | |
parent | 0cb7221701b6697dff68486b0c2059886fd1d3d2 (diff) | |
download | chromium_src-a617deabb4d37584886f61f30b14d9d887dcb0c7.zip chromium_src-a617deabb4d37584886f61f30b14d9d887dcb0c7.tar.gz chromium_src-a617deabb4d37584886f61f30b14d9d887dcb0c7.tar.bz2 |
Makes LauncherUpdater not update the icon for
TYPE_APP_PANEL. Otherwise we won't use the app icon that
ChromeLauncherDelegate fetches.
BUG=122010
TEST=see bug
R=stevenjb@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10008026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131086 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/views/ash/launcher/launcher_updater.cc | 33 |
2 files changed, 15 insertions, 22 deletions
diff --git a/chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc b/chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc index 38281bc..c85af6d 100644 --- a/chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc +++ b/chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc @@ -221,7 +221,7 @@ ash::LauncherID ChromeLauncherDelegate::CreateAppLauncherItem( item.type = ash::TYPE_APP_SHORTCUT; } else if (app_type == APP_TYPE_APP_PANEL || app_type == APP_TYPE_EXTENSION_PANEL) { - item.type = ash::TYPE_APP_PANEL; + item.type = ash::TYPE_APP_PANEL; } else { item.type = ash::TYPE_TABBED; } @@ -358,7 +358,7 @@ void ChromeLauncherDelegate::SetAppImage(const std::string& id, continue; int index = model_->ItemIndexByID(i->first); ash::LauncherItem item = model_->items()[index]; - item.image = image ? *image : Extension::GetDefaultIcon(true); + item.image = image ? *image : Extension::GetDefaultIcon(true); model_->Set(index, item); // It's possible we're waiting on more than one item, so don't break. } diff --git a/chrome/browser/ui/views/ash/launcher/launcher_updater.cc b/chrome/browser/ui/views/ash/launcher/launcher_updater.cc index 475c127..0e4ccd5 100644 --- a/chrome/browser/ui/views/ash/launcher/launcher_updater.cc +++ b/chrome/browser/ui/views/ash/launcher/launcher_updater.cc @@ -151,6 +151,9 @@ void LauncherUpdater::FaviconUpdated() { } void LauncherUpdater::UpdateLauncher(TabContentsWrapper* tab) { + if (type_ == TYPE_APP_PANEL) + return; // Maintained entirely by ChromeLauncherDelegate. + if (!tab) return; // Assume the window is going to be closed if there are no tabs. @@ -159,27 +162,16 @@ void LauncherUpdater::UpdateLauncher(TabContentsWrapper* tab) { return; ash::LauncherItem item = launcher_model()->items()[item_index]; - if (type_ != TYPE_TABBED) { - SkBitmap new_image; - if (type_ == TYPE_EXTENSION_PANEL) { - if (!favicon_loader_.get() || - favicon_loader_->web_contents() != tab->web_contents()) { - favicon_loader_.reset( - new LauncherFaviconLoader(this, tab->web_contents())); - } - // Update the icon for app panels. - new_image = favicon_loader_->GetFavicon(); - if (new_image.empty()) { - if (tab->extension_tab_helper()->GetExtensionAppIcon()) - new_image = *tab->extension_tab_helper()->GetExtensionAppIcon(); - } - } else { - // Use the app icon if we can. - if (tab->extension_tab_helper()->GetExtensionAppIcon()) - new_image = *tab->extension_tab_helper()->GetExtensionAppIcon(); - else - new_image = tab->favicon_tab_helper()->GetFavicon(); + if (type_ == TYPE_EXTENSION_PANEL) { + if (!favicon_loader_.get() || + favicon_loader_->web_contents() != tab->web_contents()) { + favicon_loader_.reset( + new LauncherFaviconLoader(this, tab->web_contents())); } + // Update the icon for extension panels. + SkBitmap new_image = favicon_loader_->GetFavicon(); + if (new_image.empty() && tab->extension_tab_helper()->GetExtensionAppIcon()) + new_image = *tab->extension_tab_helper()->GetExtensionAppIcon(); // Only update the icon if we have a new image, or none has been set yet. // This avoids flickering to an empty image when a pinned app is opened. if (!new_image.empty()) @@ -187,6 +179,7 @@ void LauncherUpdater::UpdateLauncher(TabContentsWrapper* tab) { else if (item.image.empty()) item.image = Extension::GetDefaultIcon(true); } else { + DCHECK_EQ(TYPE_TABBED, type_); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); if (tab->favicon_tab_helper()->ShouldDisplayFavicon()) { item.image = tab->favicon_tab_helper()->GetFavicon(); |