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

Side by Side Diff: chrome/browser/extensions/extension_context_menu_model.cc

Issue 9960087: Revert 13676 - Revert 131665 - Add a preference for why an extension is disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_context_menu_model.h" 5 #include "chrome/browser/extensions/extension_context_menu_model.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_tab_util.h" 9 #include "chrome/browser/extensions/extension_tab_util.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension, 128 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension,
129 browser_); 129 browser_);
130 break; 130 break;
131 case HIDE: { 131 case HIDE: {
132 ExtensionService* extension_service = profile_->GetExtensionService(); 132 ExtensionService* extension_service = profile_->GetExtensionService();
133 extension_service->SetBrowserActionVisibility(extension, false); 133 extension_service->SetBrowserActionVisibility(extension, false);
134 break; 134 break;
135 } 135 }
136 case DISABLE: { 136 case DISABLE: {
137 ExtensionService* extension_service = profile_->GetExtensionService(); 137 ExtensionService* extension_service = profile_->GetExtensionService();
138 extension_service->DisableExtension(extension_id_); 138 extension_service->DisableExtension(extension_id_,
139 Extension::DISABLE_USER_ACTION);
139 break; 140 break;
140 } 141 }
141 case UNINSTALL: { 142 case UNINSTALL: {
142 AddRef(); // Balanced in Accepted() and Canceled() 143 AddRef(); // Balanced in Accepted() and Canceled()
143 extension_uninstall_dialog_.reset( 144 extension_uninstall_dialog_.reset(
144 ExtensionUninstallDialog::Create(profile_, this)); 145 ExtensionUninstallDialog::Create(profile_, this));
145 extension_uninstall_dialog_->ConfirmUninstall(extension); 146 extension_uninstall_dialog_->ConfirmUninstall(extension);
146 break; 147 break;
147 } 148 }
148 case MANAGE: { 149 case MANAGE: {
(...skipping 19 matching lines...) Expand all
168 } 169 }
169 170
170 void ExtensionContextMenuModel::ExtensionUninstallCanceled() { 171 void ExtensionContextMenuModel::ExtensionUninstallCanceled() {
171 Release(); 172 Release();
172 } 173 }
173 174
174 const Extension* ExtensionContextMenuModel::GetExtension() const { 175 const Extension* ExtensionContextMenuModel::GetExtension() const {
175 ExtensionService* extension_service = profile_->GetExtensionService(); 176 ExtensionService* extension_service = profile_->GetExtensionService();
176 return extension_service->GetExtensionById(extension_id_, false); 177 return extension_service->GetExtensionById(extension_id_, false);
177 } 178 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_browsertest.cc ('k') | chrome/browser/extensions/extension_disabled_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698