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

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

Issue 2867008: Show extension icons next to their top-level context menu items.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_menu_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_api.h" 5 #include "chrome/browser/extensions/extension_context_menu_api.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/extensions/extensions_service.h" 8 #include "chrome/browser/extensions/extensions_service.h"
9 #include "chrome/browser/profile.h" 9 #include "chrome/browser/profile.h"
10 10
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 if (!parent) { 181 if (!parent) {
182 error_ = "Cannot find menu item with id " + IntToString(parent_id); 182 error_ = "Cannot find menu item with id " + IntToString(parent_id);
183 return false; 183 return false;
184 } 184 }
185 if (parent->type() != ExtensionMenuItem::NORMAL) { 185 if (parent->type() != ExtensionMenuItem::NORMAL) {
186 error_ = kParentsMustBeNormalError; 186 error_ = kParentsMustBeNormalError;
187 return false; 187 return false;
188 } 188 }
189 id = menu_manager->AddChildItem(parent_id, item.release()); 189 id = menu_manager->AddChildItem(parent_id, item.release());
190 } else { 190 } else {
191 id = menu_manager->AddContextItem(item.release()); 191 id = menu_manager->AddContextItem(GetExtension(), item.release());
192 } 192 }
193 193
194 if (id <= 0) 194 if (id <= 0)
195 return false; 195 return false;
196 196
197 if (has_callback()) 197 if (has_callback())
198 result_.reset(Value::CreateIntegerValue(id)); 198 result_.reset(Value::CreateIntegerValue(id));
199 199
200 return true; 200 return true;
201 } 201 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 return manager->RemoveContextMenuItem(id); 286 return manager->RemoveContextMenuItem(id);
287 } 287 }
288 288
289 bool RemoveAllContextMenusFunction::RunImpl() { 289 bool RemoveAllContextMenusFunction::RunImpl() {
290 ExtensionsService* service = profile()->GetExtensionsService(); 290 ExtensionsService* service = profile()->GetExtensionsService();
291 ExtensionMenuManager* manager = service->menu_manager(); 291 ExtensionMenuManager* manager = service->menu_manager();
292 manager->RemoveAllContextItems(extension_id()); 292 manager->RemoveAllContextItems(extension_id());
293 return true; 293 return true;
294 } 294 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_menu_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698