diff options
author | skerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-14 18:13:06 +0000 |
---|---|---|
committer | skerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-14 18:13:06 +0000 |
commit | e5adff747e7ceed4b4fcd32ebcfbe2fa06786e7c (patch) | |
tree | 5ef5da00b6b046c6a5884bf9b280dd26c45932da /chrome | |
parent | 3552637a08a8516bb720a71851125eefa081de1d (diff) | |
download | chromium_src-e5adff747e7ceed4b4fcd32ebcfbe2fa06786e7c.zip chromium_src-e5adff747e7ceed4b4fcd32ebcfbe2fa06786e7c.tar.gz chromium_src-e5adff747e7ceed4b4fcd32ebcfbe2fa06786e7c.tar.bz2 |
Remove app icon from non-app tabs.
BUG=44914
TEST=manual
Review URL: http://codereview.chromium.org/2696004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49698 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 44 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 7 |
2 files changed, 2 insertions, 49 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 8fc2d32..e398ded 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -281,7 +281,6 @@ TabContents::TabContents(Profile* profile, last_search_case_sensitive_(false), last_search_result_(), extension_app_(NULL), - extension_app_for_current_page_(NULL), capturing_contents_(false), is_being_destroyed_(false), notify_disconnection_(false), @@ -841,10 +840,6 @@ bool TabContents::NavigateToPendingEntry( favicon_service->SetFaviconOutOfDateForPage(entry.url()); } - // The url likely changed, see if there is an extension whose extent contains - // the current page. - UpdateExtensionAppForCurrentPage(); - return true; } @@ -866,7 +861,6 @@ TabContents* TabContents::Clone() { MSG_ROUTING_NONE, this); tc->controller().CopyStateFrom(controller_); tc->extension_app_ = extension_app_; - tc->extension_app_for_current_page_ = extension_app_for_current_page_; tc->extension_app_icon_ = extension_app_icon_; return tc; } @@ -1620,10 +1614,6 @@ void TabContents::DidNavigateMainFramePostCommit( // Clear the cache of forms in AutoFill. if (autofill_manager_.get()) autofill_manager_->Reset(); - - // The url likely changed, see if there is an extension whose extent contains - // the current page. - UpdateExtensionAppForCurrentPage(); } void TabContents::DidNavigateAnyFramePostCommit( @@ -2994,26 +2984,12 @@ void TabContents::Observe(NotificationType type, break; } - case NotificationType::EXTENSION_LOADED: { - if (!extension_app_ && !extension_app_for_current_page_ && - Source<Profile>(source).ptr() == profile()) { - UpdateExtensionAppForCurrentPage(); - if (extension_app_for_current_page_) - NotifyNavigationStateChanged(INVALIDATE_TAB); - } + case NotificationType::EXTENSION_LOADED: break; - } case NotificationType::EXTENSION_UNLOADED: - case NotificationType::EXTENSION_UNLOADED_DISABLED: { - if (extension_app_for_current_page_ == - Details<Extension>(details).ptr()) { - extension_app_for_current_page_ = NULL; - UpdateExtensionAppForCurrentPage(); - NotifyNavigationStateChanged(INVALIDATE_TAB); - } + case NotificationType::EXTENSION_UNLOADED_DISABLED: break; - } default: NOTREACHED(); @@ -3046,22 +3022,6 @@ Extension* TabContents::GetExtensionContaining(const GURL& url) { extension : extensions_service->GetExtensionByWebExtent(url); } -void TabContents::UpdateExtensionAppForCurrentPage() { - if (extension_app_) { - // Tab has an explicit app extension; nothing to do. - return; - } - - // Check the current extension before iterating through all extensions. - if (extension_app_for_current_page_ && - extension_app_for_current_page_->web_extent().ContainsURL(GetURL())) { - return; - } - - extension_app_for_current_page_ = GetExtensionContaining(GetURL()); - UpdateExtensionAppIcon(extension_app_for_current_page_); -} - void TabContents::OnImageLoaded(SkBitmap* image, ExtensionResource resource, int index) { if (image) { diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index be0a4a2..fe5bab9 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -1037,9 +1037,6 @@ class TabContents : public PageNavigator, // ImageLoadingTracker to load the extension's image. void UpdateExtensionAppIcon(Extension* extension); - // Called on every navigation to update app_icon_cache_entry_ as necessary. - void UpdateExtensionAppForCurrentPage(); - // ImageLoadingTracker::Observer. virtual void OnImageLoaded(SkBitmap* image, ExtensionResource resource, int index); @@ -1207,10 +1204,6 @@ class TabContents : public PageNavigator, // created for. Extension* extension_app_; - // If extension_app_ is NULL and there is an extension whose extent contains - // the current url, this is the extension. - Extension* extension_app_for_current_page_; - // Icon for extension_app_ (if non-null) or extension_for_current_page_. SkBitmap extension_app_icon_; |