Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(946)

Unified Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 12094034: Add a link (to view Permissions) to the Extension details on chrome://extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_settings_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_settings_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698