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

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

Issue 2396903002: Supervised Users always need custodian approval for permission increase (Closed)
Patch Set: Remove deleted method from the header file. Created 4 years, 2 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_disabled_ui.cc
diff --git a/chrome/browser/extensions/extension_disabled_ui.cc b/chrome/browser/extensions/extension_disabled_ui.cc
index 885fc5df26e5eace51143b79028c3e9e6d843d87..f23350b69c8119c24814b2027dbcd0059aae42f2 100644
--- a/chrome/browser/extensions/extension_disabled_ui.cc
+++ b/chrome/browser/extensions/extension_disabled_ui.cc
@@ -319,9 +319,7 @@ ExtensionDisabledGlobalError::GetBubbleViewMessages() {
base::string16 ExtensionDisabledGlobalError::GetBubbleViewAcceptButtonLabel() {
if (extensions::util::IsExtensionSupervised(extension_,
- service_->profile()) &&
- extensions::util::NeedCustodianApprovalForPermissionIncrease(
- service_->profile())) {
+ service_->profile())) {
// TODO(treib): Probably use a new string here once we get UX design.
// For now, just use "OK". crbug.com/461261
return l10n_util::GetStringUTF16(IDS_OK);
@@ -338,16 +336,10 @@ base::string16 ExtensionDisabledGlobalError::GetBubbleViewAcceptButtonLabel() {
base::string16 ExtensionDisabledGlobalError::GetBubbleViewCancelButtonLabel() {
if (extensions::util::IsExtensionSupervised(extension_,
service_->profile())) {
- if (extensions::util::NeedCustodianApprovalForPermissionIncrease(
- service_->profile())) {
- // If the supervised user can't approve the update, then there is no
- // "cancel" button.
- return base::string16();
- } else {
- // Supervised users can not remove extensions, so use "cancel" here
- // instead of "uninstall".
- return l10n_util::GetStringUTF16(IDS_CANCEL);
- }
+ // The supervised user can't approve the update, and hence there is no
+ // "cancel" button. Return an empty string such that the "cancel" button
+ // is not shown in the dialog.
+ return base::string16();
}
return l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNINSTALL);
}
@@ -358,9 +350,7 @@ void ExtensionDisabledGlobalError::OnBubbleViewDidClose(Browser* browser) {
void ExtensionDisabledGlobalError::BubbleViewAcceptButtonPressed(
Browser* browser) {
if (extensions::util::IsExtensionSupervised(extension_,
- service_->profile()) &&
- extensions::util::NeedCustodianApprovalForPermissionIncrease(
- service_->profile())) {
+ service_->profile())) {
return;
}
// Delay extension reenabling so this bubble closes properly.
@@ -372,16 +362,11 @@ void ExtensionDisabledGlobalError::BubbleViewAcceptButtonPressed(
void ExtensionDisabledGlobalError::BubbleViewCancelButtonPressed(
Browser* browser) {
- if (extensions::util::IsExtensionSupervised(extension_,
- service_->profile())) {
- // For custodian-installed extensions, this button should only exist if the
- // supervised user can approve the update. Otherwise there is only an "OK"
- // button.
- DCHECK(!extensions::util::NeedCustodianApprovalForPermissionIncrease(
- service_->profile()));
- // Supervised users may never remove custodian-installed extensions.
- return;
- }
+ // For custodian-installed extensions, this button should not exist because
+ // there is only an "OK" button.
+ // Supervised users may never remove custodian-installed extensions.
+ DCHECK(!extensions::util::IsExtensionSupervised(extension_,
+ service_->profile()));
uninstall_dialog_.reset(extensions::ExtensionUninstallDialog::Create(
service_->profile(), browser->window()->GetNativeWindow(), this));
« no previous file with comments | « chrome/browser/extensions/api/webstore_private/webstore_private_api.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698