diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-14 22:32:39 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-14 22:32:39 +0000 |
commit | 0c6da50c299be943b4c04a3953e0931734af7eaf (patch) | |
tree | b5fa120b75591c1fa56a07232cf685ac1b2a8eb8 /chrome/browser/browser.cc | |
parent | a7918784c2ac95844ae775be2fef06cd3efb092c (diff) | |
download | chromium_src-0c6da50c299be943b4c04a3953e0931734af7eaf.zip chromium_src-0c6da50c299be943b4c04a3953e0931734af7eaf.tar.gz chromium_src-0c6da50c299be943b4c04a3953e0931734af7eaf.tar.bz2 |
Disable an extension when it is upgraded to a version that requires more
permissions then before, and prompt the user to re-enable.
Incidentally, this required adding support for disabling extensions.
BUG=12140
TEST=covered by unit tests
Review URL: http://codereview.chromium.org/165414
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 8183090..5478464 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -23,6 +23,7 @@ #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_shelf.h" #include "chrome/browser/download/download_started_animation.h" +#include "chrome/browser/extensions/extension_disabled_infobar_delegate.h" #include "chrome/browser/find_bar.h" #include "chrome/browser/find_bar_controller.h" #include "chrome/browser/location_bar.h" @@ -188,6 +189,8 @@ Browser::Browser(Type type, Profile* profile) registrar_.Add(this, NotificationType::SSL_VISIBLE_STATE_CHANGED, NotificationService::AllSources()); + registrar_.Add(this, NotificationType::EXTENSION_UPDATE_DISABLED, + NotificationService::AllSources()); registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, NotificationService::AllSources()); registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, @@ -2079,6 +2082,14 @@ void Browser::Observe(NotificationType type, UpdateToolbar(false); break; + case NotificationType::EXTENSION_UPDATE_DISABLED: { + // Show the UI. + ExtensionsService* service = Source<ExtensionsService>(source).ptr(); + Extension* extension = Details<Extension>(details).ptr(); + ShowExtensionDisabledUI(service, profile_, extension); + break; + } + case NotificationType::EXTENSION_UNLOADED: { // Close any tabs from the unloaded extension. Extension* extension = Details<Extension>(details).ptr(); |