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

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

Issue 284103002: Replace "external_install" boolean parameter with explicit enumeration in ExtensionUninstall method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address issue exposed by failing unit test. Created 6 years, 5 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
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/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" 9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
10 #include "chrome/browser/extensions/extension_action.h" 10 #include "chrome/browser/extensions/extension_action.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 break; 137 break;
138 } 138 }
139 default: 139 default:
140 NOTREACHED() << "Unknown option"; 140 NOTREACHED() << "Unknown option";
141 break; 141 break;
142 } 142 }
143 } 143 }
144 144
145 void ExtensionContextMenuModel::ExtensionUninstallAccepted() { 145 void ExtensionContextMenuModel::ExtensionUninstallAccepted() {
146 if (GetExtension()) { 146 if (GetExtension()) {
147 extensions::ExtensionSystem::Get(profile_)->extension_service()-> 147 extensions::ExtensionSystem::Get(profile_)
148 UninstallExtension(extension_id_, false, NULL); 148 ->extension_service()
149 ->UninstallExtension(extension_id_,
150 ExtensionService::UNINSTALL_REASON_USER_INITIATED,
151 NULL);
149 } 152 }
150 Release(); 153 Release();
151 } 154 }
152 155
153 void ExtensionContextMenuModel::ExtensionUninstallCanceled() { 156 void ExtensionContextMenuModel::ExtensionUninstallCanceled() {
154 Release(); 157 Release();
155 } 158 }
156 159
157 ExtensionContextMenuModel::~ExtensionContextMenuModel() {} 160 ExtensionContextMenuModel::~ExtensionContextMenuModel() {}
158 161
(...skipping 18 matching lines...) Expand all
177 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON); 180 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON);
178 AddSeparator(ui::NORMAL_SEPARATOR); 181 AddSeparator(ui::NORMAL_SEPARATOR);
179 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSION); 182 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSION);
180 } 183 }
181 184
182 const Extension* ExtensionContextMenuModel::GetExtension() const { 185 const Extension* ExtensionContextMenuModel::GetExtension() const {
183 ExtensionService* extension_service = 186 ExtensionService* extension_service =
184 extensions::ExtensionSystem::Get(profile_)->extension_service(); 187 extensions::ExtensionSystem::Get(profile_)->extension_service();
185 return extension_service->GetExtensionById(extension_id_, false); 188 return extension_service->GetExtensionById(extension_id_, false);
186 } 189 }
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