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

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

Issue 421193002: Fix ExtensionServiceTest.ClearExtensionData flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use base::DoNothing for empty callbacks 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 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/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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 default: 141 default:
142 NOTREACHED() << "Unknown option"; 142 NOTREACHED() << "Unknown option";
143 break; 143 break;
144 } 144 }
145 } 145 }
146 146
147 void ExtensionContextMenuModel::ExtensionUninstallAccepted() { 147 void ExtensionContextMenuModel::ExtensionUninstallAccepted() {
148 if (GetExtension()) { 148 if (GetExtension()) {
149 extensions::ExtensionSystem::Get(profile_) 149 extensions::ExtensionSystem::Get(profile_)
150 ->extension_service() 150 ->extension_service()
151 ->UninstallExtension( 151 ->UninstallExtension(extension_id_,
152 extension_id_, extensions::UNINSTALL_REASON_USER_INITIATED, NULL); 152 extensions::UNINSTALL_REASON_USER_INITIATED,
153 base::Bind(&base::DoNothing),
154 NULL);
153 } 155 }
154 Release(); 156 Release();
155 } 157 }
156 158
157 void ExtensionContextMenuModel::ExtensionUninstallCanceled() { 159 void ExtensionContextMenuModel::ExtensionUninstallCanceled() {
158 Release(); 160 Release();
159 } 161 }
160 162
161 ExtensionContextMenuModel::~ExtensionContextMenuModel() {} 163 ExtensionContextMenuModel::~ExtensionContextMenuModel() {}
162 164
(...skipping 18 matching lines...) Expand all
181 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON); 183 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON);
182 AddSeparator(ui::NORMAL_SEPARATOR); 184 AddSeparator(ui::NORMAL_SEPARATOR);
183 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSION); 185 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSION);
184 } 186 }
185 187
186 const Extension* ExtensionContextMenuModel::GetExtension() const { 188 const Extension* ExtensionContextMenuModel::GetExtension() const {
187 ExtensionService* extension_service = 189 ExtensionService* extension_service =
188 extensions::ExtensionSystem::Get(profile_)->extension_service(); 190 extensions::ExtensionSystem::Get(profile_)->extension_service();
189 return extension_service->GetExtensionById(extension_id_, false); 191 return extension_service->GetExtensionById(extension_id_, false);
190 } 192 }
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