Index: chrome/browser/ui/webui/extensions/extension_settings_handler.cc |
=================================================================== |
--- chrome/browser/ui/webui/extensions/extension_settings_handler.cc (revision 179321) |
+++ chrome/browser/ui/webui/extensions/extension_settings_handler.cc (working copy) |
@@ -300,6 +300,8 @@ |
l10n_util::GetStringUTF16(IDS_EXTENSIONS_RELOAD_UNPACKED)); |
source->AddString("extensionSettingsOptions", |
l10n_util::GetStringUTF16(IDS_EXTENSIONS_OPTIONS_LINK)); |
+ source->AddString("extensionSettingsPermissions", |
+ l10n_util::GetStringUTF16(IDS_EXTENSIONS_PERMISSIONS_LINK)); |
source->AddString("extensionSettingsActivity", |
l10n_util::GetStringUTF16(IDS_EXTENSIONS_ACTIVITY_LINK)); |
source->AddString("extensionSettingsVisitWebsite", |
@@ -394,6 +396,9 @@ |
web_ui()->RegisterMessageCallback("extensionSettingsOptions", |
base::Bind(&ExtensionSettingsHandler::HandleOptionsMessage, |
base::Unretained(this))); |
+ web_ui()->RegisterMessageCallback("extensionSettingsPermissions", |
+ base::Bind(&ExtensionSettingsHandler::HandlePermissionsMessage, |
+ base::Unretained(this))); |
web_ui()->RegisterMessageCallback("extensionSettingsShowButton", |
base::Bind(&ExtensionSettingsHandler::HandleShowButtonMessage, |
base::Unretained(this))); |
@@ -501,6 +506,14 @@ |
MaybeUpdateAfterNotification(); |
} |
+void ExtensionSettingsHandler::InstallUIProceed() { |
+ // This should never happen. The dialog only has a cancel button. |
+ NOTREACHED(); |
+} |
+ |
+void ExtensionSettingsHandler::InstallUIAbort(bool user_initiated) { |
+} |
+ |
void ExtensionSettingsHandler::ReloadUnpackedExtensions() { |
const ExtensionSet* extensions = extension_service_->extensions(); |
std::vector<const Extension*> unpacked_extensions; |
@@ -794,6 +807,18 @@ |
chrome::FindBrowserWithWebContents(web_ui()->GetWebContents())); |
} |
+void ExtensionSettingsHandler::HandlePermissionsMessage(const ListValue* args) { |
+ std::string extension_id(UTF16ToUTF8(ExtractStringValue(args))); |
+ CHECK(!extension_id.empty()); |
+ const Extension* extension = |
+ extension_service_->GetExtensionById(extension_id, true); |
+ if (!extension) |
+ return; |
+ |
+ prompt_.reset(new ExtensionInstallPrompt(web_contents())); |
+ prompt_->ReviewPermissions(this, extension); |
+} |
+ |
void ExtensionSettingsHandler::HandleShowButtonMessage(const ListValue* args) { |
const Extension* extension = GetActiveExtension(args); |
if (!extension) |