diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 07:19:51 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 07:19:51 +0000 |
commit | 8eb043bfe08751a7ef5375308be84658cfa4f860 (patch) | |
tree | ba02def9e79e6b1a41eab8dcbf943238d0193f40 /chrome/browser | |
parent | f72a1ccce08050ede3d1e46cbbcd9cf5b3a1c236 (diff) | |
download | chromium_src-8eb043bfe08751a7ef5375308be84658cfa4f860.zip chromium_src-8eb043bfe08751a7ef5375308be84658cfa4f860.tar.gz chromium_src-8eb043bfe08751a7ef5375308be84658cfa4f860.tar.bz2 |
Unbreak app tab icons. The bigger app tab icons weren't showing up.
TBR=finnur@chromium.org
Review URL: http://codereview.chromium.org/1808004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 25 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 2 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_renderer.cc | 7 |
3 files changed, 21 insertions, 13 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index f3fe7d7..cfb18cb 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -518,6 +518,22 @@ void TabContents::SetAppExtensionById(const std::string& app_extension_id) { } } +SkBitmap* TabContents::GetAppExtensionIcon() { + // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because + // for those windows, we already have a big icon in the top-left outside any + // tab. Having big tab icons too looks kinda redonk. + if (delegate_ && + delegate_->GetBrowser() && + delegate_->GetBrowser()->type() == Browser::TYPE_EXTENSION_APP) { + return NULL; + } + + if (app_extension_icon_.empty()) + return NULL; + + return &app_extension_icon_; +} + const GURL& TabContents::GetURL() const { // We may not have a navigation entry yet NavigationEntry* entry = controller_.GetActiveEntry(); @@ -2958,15 +2974,6 @@ void TabContents::Observe(NotificationType type, void TabContents::UpdateAppExtensionIcon(Extension* extension) { app_extension_icon_.reset(); - // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because - // for those windows, we already have a big icon in the top-left outside any - // tab. Having big tab icons too looks kinda redonk. - if (!delegate_ || - !delegate_->GetBrowser() || - delegate_->GetBrowser()->type() == Browser::TYPE_EXTENSION_APP) { - return; - } - if (extension) { app_extension_image_loader_.reset(new ImageLoadingTracker(this)); app_extension_image_loader_->LoadImage( diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 5846021..490aea2 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -213,7 +213,7 @@ class TabContents : public PageNavigator, // // NOTE: the returned icon is larger than 16x16 (it's size is // Extension::EXTENSION_ICON_SMALLISH). - const SkBitmap& app_extension_icon() const { return app_extension_icon_; } + SkBitmap* GetAppExtensionIcon(); // Tab navigation state ------------------------------------------------------ diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index ec43a13..9220907 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -318,11 +318,12 @@ void TabRenderer::UpdateData(TabContents* contents, data_.title = contents->GetTitle(); data_.off_the_record = contents->profile()->IsOffTheRecord(); data_.crashed = contents->is_crashed(); - SkBitmap app_icon = contents->app_extension_icon(); - if (!app_icon.empty()) - data_.favicon = app_icon; + SkBitmap* app_icon = contents->GetAppExtensionIcon(); + if (app_icon) + data_.favicon = *app_icon; else data_.favicon = contents->GetFavIcon(); + data_.phantom = phantom; data_.app = contents->is_app(); |