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

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: Created 8 years, 3 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/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 } 81 }
79 } 82 }
80 return contexts; 83 return contexts;
81 } 84 }
82 85
83 template<typename PropertyWithEnumT> 86 template<typename PropertyWithEnumT>
84 extensions::MenuItem::Type GetType(const PropertyWithEnumT& property) { 87 extensions::MenuItem::Type GetType(const PropertyWithEnumT& property) {
85 switch (property.type) { 88 switch (property.type) {
86 case PropertyWithEnumT::TYPE_NONE: 89 case PropertyWithEnumT::TYPE_NONE:
87 case PropertyWithEnumT::TYPE_NORMAL: 90 case PropertyWithEnumT::TYPE_NORMAL:
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 365
363 bool RemoveAllContextMenusFunction::RunImpl() { 366 bool RemoveAllContextMenusFunction::RunImpl() {
364 ExtensionService* service = profile()->GetExtensionService(); 367 ExtensionService* service = profile()->GetExtensionService();
365 MenuManager* manager = service->menu_manager(); 368 MenuManager* manager = service->menu_manager();
366 manager->RemoveAllContextItems(GetExtension()->id()); 369 manager->RemoveAllContextItems(GetExtension()->id());
367 manager->WriteToStorage(GetExtension()); 370 manager->WriteToStorage(GetExtension());
368 return true; 371 return true;
369 } 372 }
370 373
371 } // namespace extensions 374 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/context_menu_manager.h » ('j') | chrome/browser/extensions/context_menu_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698