summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/browser.cc
diff options
context:
space:
mode:
authoryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-13 00:48:52 +0000
committeryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-13 00:48:52 +0000
commit18bc0f32f4d5784357be836443d5747c08d0a9a7 (patch)
tree32abc4c0b2a8f55d8238573578556a6118acd26e /chrome/browser/ui/browser.cc
parent7190eda8a46ca6a8b4c49f0c9e619c4570b9f2e7 (diff)
downloadchromium_src-18bc0f32f4d5784357be836443d5747c08d0a9a7.zip
chromium_src-18bc0f32f4d5784357be836443d5747c08d0a9a7.tar.gz
chromium_src-18bc0f32f4d5784357be836443d5747c08d0a9a7.tar.bz2
Fix AllSources observers for EXTENSION_READY_TO_INSTALL and BROWSER_ACTION_VISIBILITY_CHANGED.
Make NOTIFICATION_EXTENSION_READY_FOR_INSTALL sent from the Profile. We need this because the profile can't be gotten from the DownloadManager, and the notification can be sent from the incognito profile. BUG=94034 TEST=existing test Review URL: http://codereview.chromium.org/8228020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105224 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser.cc')
-rw-r--r--chrome/browser/ui/browser.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index b21a519e..0b10414 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -4035,17 +4035,19 @@ void Browser::Observe(int type,
break;
case chrome::NOTIFICATION_EXTENSION_READY_FOR_INSTALL: {
- // Handle EXTENSION_READY_FOR_INSTALL for last active tabbed browser.
- if (BrowserList::FindTabbedBrowser(profile(), true) != this)
- break;
-
- // We only want to show the loading dialog for themes, but we don't want
- // to wait until unpack to find out an extension is a theme, so we test
- // the download_url GURL instead. This means that themes in the extensions
- // gallery won't get the loading dialog.
- GURL download_url = *(Details<GURL>(details).ptr());
- if (ExtensionService::IsDownloadFromMiniGallery(download_url))
- window()->ShowThemeInstallBubble();
+ Profile* profile = Source<Profile>(source).ptr();
+ if (profile_->IsSameProfile(profile)) {
+ // Handle EXTENSION_READY_FOR_INSTALL for last active tabbed browser.
+ if (BrowserList::FindTabbedBrowser(profile, true) == this) {
+ // We only want to show the loading dialog for themes, but we don't
+ // want to wait until unpack to find out an extension is a theme, so
+ // we test the download_url GURL instead. This means that themes in
+ // the extensions gallery won't get the loading dialog.
+ GURL download_url = *(Details<GURL>(details).ptr());
+ if (ExtensionService::IsDownloadFromMiniGallery(download_url))
+ window()->ShowThemeInstallBubble();
+ }
+ }
break;
}