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

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

Issue 10984034: Revert 158691 - 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, 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;
81 case PropertyWithEnumT::CONTEXTS_ELEMENT_NONE: 78 case PropertyWithEnumT::CONTEXTS_ELEMENT_NONE:
82 NOTREACHED(); 79 NOTREACHED();
83 } 80 }
84 } 81 }
85 return contexts; 82 return contexts;
86 } 83 }
87 84
88 template<typename PropertyWithEnumT> 85 template<typename PropertyWithEnumT>
89 extensions::MenuItem::Type GetType(const PropertyWithEnumT& property) { 86 extensions::MenuItem::Type GetType(const PropertyWithEnumT& property) {
90 switch (property.type) { 87 switch (property.type) {
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 369
373 bool RemoveAllContextMenusFunction::RunImpl() { 370 bool RemoveAllContextMenusFunction::RunImpl() {
374 ExtensionService* service = profile()->GetExtensionService(); 371 ExtensionService* service = profile()->GetExtensionService();
375 MenuManager* manager = service->menu_manager(); 372 MenuManager* manager = service->menu_manager();
376 manager->RemoveAllContextItems(GetExtension()->id()); 373 manager->RemoveAllContextItems(GetExtension()->id());
377 manager->WriteToStorage(GetExtension()); 374 manager->WriteToStorage(GetExtension());
378 return true; 375 return true;
379 } 376 }
380 377
381 } // namespace extensions 378 } // 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