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

Unified Diff: chrome/browser/extensions/external_install_error.cc

Issue 501273002: Update extension install prompt to reflect withheld permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update cocoa test, add default cases for compiler Created 6 years, 3 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
Index: chrome/browser/extensions/external_install_error.cc
diff --git a/chrome/browser/extensions/external_install_error.cc b/chrome/browser/extensions/external_install_error.cc
index c01e8da854fac0db1f97bc682bc7eb487222a13e..d93b714b0cc835740d64c1703248eca5d56888b6 100644
--- a/chrome/browser/extensions/external_install_error.cc
+++ b/chrome/browser/extensions/external_install_error.cc
@@ -203,13 +203,29 @@ base::string16 ExternalInstallBubbleAlert::GetBubbleViewTitle() {
std::vector<base::string16>
ExternalInstallBubbleAlert::GetBubbleViewMessages() {
+ ExtensionInstallPrompt::PermissionsType regular_permissions =
+ ExtensionInstallPrompt::PermissionsType::REGULAR_PERMISSIONS;
+ ExtensionInstallPrompt::PermissionsType withheld_permissions =
+ ExtensionInstallPrompt::PermissionsType::WITHHELD_PERMISSIONS;
+
std::vector<base::string16> messages;
messages.push_back(prompt_->GetHeading());
- if (prompt_->GetPermissionCount()) {
- messages.push_back(prompt_->GetPermissionsHeading());
- for (size_t i = 0; i < prompt_->GetPermissionCount(); ++i) {
+ if (prompt_->GetPermissionCount(regular_permissions)) {
+ messages.push_back(prompt_->GetPermissionsHeading(regular_permissions));
+ for (size_t i = 0; i < prompt_->GetPermissionCount(regular_permissions);
+ ++i) {
+ messages.push_back(l10n_util::GetStringFUTF16(
+ IDS_EXTENSION_PERMISSION_LINE,
+ prompt_->GetPermission(i, regular_permissions)));
+ }
+ }
+ if (prompt_->GetPermissionCount(withheld_permissions)) {
+ messages.push_back(prompt_->GetPermissionsHeading(withheld_permissions));
+ for (size_t i = 0; i < prompt_->GetPermissionCount(withheld_permissions);
+ ++i) {
messages.push_back(l10n_util::GetStringFUTF16(
- IDS_EXTENSION_PERMISSION_LINE, prompt_->GetPermission(i)));
+ IDS_EXTENSION_PERMISSION_LINE,
+ prompt_->GetPermission(i, withheld_permissions)));
}
}
// TODO(yoz): OAuth issue advice?
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt_unittest.cc ('k') | chrome/browser/extensions/permissions_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698