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

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

Issue 501273002: Update extension install prompt to reflect withheld permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added init calls for other types of installs Created 6 years, 4 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/extension_install_prompt.cc
diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc
index dec1aa54f3b756b3d1ba147b74b8179e6c912cf0..8ab04ea7524da8527ed0fea85a20d6dad8184784 100644
--- a/chrome/browser/extensions/extension_install_prompt.cc
+++ b/chrome/browser/extensions/extension_install_prompt.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/extensions/bundle_installer.h"
#include "chrome/browser/extensions/extension_install_ui.h"
#include "chrome/browser/extensions/extension_util.h"
+#include "chrome/browser/extensions/permissions_updater.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
@@ -543,6 +544,8 @@ void ExtensionInstallPrompt::ConfirmBundleInstall(
const PermissionSet* permissions) {
DCHECK(ui_loop_ == base::MessageLoop::current());
bundle_ = bundle;
+ // |bundle|'s extensions have already had their permissions initialized at
+ // this point, so withheld permissions will not show up in the prompt.
permissions_ = permissions;
delegate_ = bundle;
prompt_ = new Prompt(BUNDLE_INSTALL_PROMPT);
@@ -557,6 +560,10 @@ void ExtensionInstallPrompt::ConfirmStandaloneInstall(
scoped_refptr<Prompt> prompt) {
DCHECK(ui_loop_ == base::MessageLoop::current());
extension_ = extension;
+ // Initialize permissions so that withheld permissions don't end up in the
+ // install prompt.
+ extensions::PermissionsUpdater(install_ui_->profile()).InitializePermissions(
+ extension_);
not at google - send to devlin 2014/08/28 03:17:32 A weirdness here is that even though this is a dum
gpdavis 2014/08/28 17:41:48 Ping :) What if we just add a flag to InitializeP
not at google - send to devlin 2014/08/28 18:28:02 Yes! That's the best solution I came up with as we
permissions_ = extension->permissions_data()->active_permissions();
delegate_ = delegate;
prompt_ = prompt;
@@ -583,6 +590,10 @@ void ExtensionInstallPrompt::ConfirmInstall(
const ShowDialogCallback& show_dialog_callback) {
DCHECK(ui_loop_ == base::MessageLoop::current());
extension_ = extension;
+ // Initialize permissions so that withheld permissions don't end up in the
+ // install prompt.
+ extensions::PermissionsUpdater(install_ui_->profile()).InitializePermissions(
+ extension_);
permissions_ = extension->permissions_data()->active_permissions();
delegate_ = delegate;
prompt_ = new Prompt(INSTALL_PROMPT);

Powered by Google App Engine
This is Rietveld 408576698