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

Side by Side Diff: chrome/browser/extensions/api/context_menu/context_menu_api.cc

Issue 10918103: Give platform apps control over launcher right-click context menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and fix conflicts Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/context_menu_matcher.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) 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/api/context_menu/context_menu_api.h" 5 #include "chrome/browser/extensions/api/context_menu/context_menu_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 break; 68 break;
69 case PropertyWithEnumT::CONTEXTS_ELEMENT_VIDEO: 69 case PropertyWithEnumT::CONTEXTS_ELEMENT_VIDEO:
70 contexts.Add(extensions::MenuItem::VIDEO); 70 contexts.Add(extensions::MenuItem::VIDEO);
71 break; 71 break;
72 case PropertyWithEnumT::CONTEXTS_ELEMENT_AUDIO: 72 case PropertyWithEnumT::CONTEXTS_ELEMENT_AUDIO:
73 contexts.Add(extensions::MenuItem::AUDIO); 73 contexts.Add(extensions::MenuItem::AUDIO);
74 break; 74 break;
75 case PropertyWithEnumT::CONTEXTS_ELEMENT_FRAME: 75 case PropertyWithEnumT::CONTEXTS_ELEMENT_FRAME:
76 contexts.Add(extensions::MenuItem::FRAME); 76 contexts.Add(extensions::MenuItem::FRAME);
77 break; 77 break;
78 case PropertyWithEnumT::CONTEXTS_ELEMENT_LAUNCHER:
79 contexts.Add(extensions::MenuItem::LAUNCHER);
80 break;
78 case PropertyWithEnumT::CONTEXTS_ELEMENT_NONE: 81 case PropertyWithEnumT::CONTEXTS_ELEMENT_NONE:
79 NOTREACHED(); 82 NOTREACHED();
80 } 83 }
81 } 84 }
82 return contexts; 85 return contexts;
83 } 86 }
84 87
85 template<typename PropertyWithEnumT> 88 template<typename PropertyWithEnumT>
86 extensions::MenuItem::Type GetType(const PropertyWithEnumT& property) { 89 extensions::MenuItem::Type GetType(const PropertyWithEnumT& property) {
87 switch (property.type) { 90 switch (property.type) {
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 372
370 bool RemoveAllContextMenusFunction::RunImpl() { 373 bool RemoveAllContextMenusFunction::RunImpl() {
371 ExtensionService* service = profile()->GetExtensionService(); 374 ExtensionService* service = profile()->GetExtensionService();
372 MenuManager* manager = service->menu_manager(); 375 MenuManager* manager = service->menu_manager();
373 manager->RemoveAllContextItems(GetExtension()->id()); 376 manager->RemoveAllContextItems(GetExtension()->id());
374 manager->WriteToStorage(GetExtension()); 377 manager->WriteToStorage(GetExtension());
375 return true; 378 return true;
376 } 379 }
377 380
378 } // namespace extensions 381 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/context_menu_matcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698