OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Definition of helper functions for the ContextMenus API. | 5 // Definition of helper functions for the ContextMenus API. |
6 | 6 |
7 #ifndef CHROME_BROWSER_EXTENSIONS_API_CONTEXT_MENUS_CONTEXT_MENUS_API_HELPERS_H_ | 7 #ifndef CHROME_BROWSER_EXTENSIONS_API_CONTEXT_MENUS_CONTEXT_MENUS_API_HELPERS_H_ |
8 #define CHROME_BROWSER_EXTENSIONS_API_CONTEXT_MENUS_CONTEXT_MENUS_API_HELPERS_H_ | 8 #define CHROME_BROWSER_EXTENSIONS_API_CONTEXT_MENUS_CONTEXT_MENUS_API_HELPERS_H_ |
9 | 9 |
10 #include "chrome/browser/extensions/menu_manager.h" | 10 #include "chrome/browser/extensions/menu_manager.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 case PropertyWithEnumT::CONTEXTS_TYPE_AUDIO: | 82 case PropertyWithEnumT::CONTEXTS_TYPE_AUDIO: |
83 contexts.Add(extensions::MenuItem::AUDIO); | 83 contexts.Add(extensions::MenuItem::AUDIO); |
84 break; | 84 break; |
85 case PropertyWithEnumT::CONTEXTS_TYPE_FRAME: | 85 case PropertyWithEnumT::CONTEXTS_TYPE_FRAME: |
86 contexts.Add(extensions::MenuItem::FRAME); | 86 contexts.Add(extensions::MenuItem::FRAME); |
87 break; | 87 break; |
88 case PropertyWithEnumT::CONTEXTS_TYPE_LAUNCHER: | 88 case PropertyWithEnumT::CONTEXTS_TYPE_LAUNCHER: |
89 // Not available for <webview>. | 89 // Not available for <webview>. |
90 contexts.Add(extensions::MenuItem::LAUNCHER); | 90 contexts.Add(extensions::MenuItem::LAUNCHER); |
91 break; | 91 break; |
| 92 case PropertyWithEnumT::CONTEXTS_TYPE_BROWSER_ACTION: |
| 93 contexts.Add(extensions::MenuItem::BROWSER_ACTION); |
| 94 break; |
| 95 case PropertyWithEnumT::CONTEXTS_TYPE_PAGE_ACTION: |
| 96 contexts.Add(extensions::MenuItem::PAGE_ACTION); |
| 97 break; |
92 case PropertyWithEnumT::CONTEXTS_TYPE_NONE: | 98 case PropertyWithEnumT::CONTEXTS_TYPE_NONE: |
93 NOTREACHED(); | 99 NOTREACHED(); |
94 } | 100 } |
95 } | 101 } |
96 return contexts; | 102 return contexts; |
97 } | 103 } |
98 | 104 |
99 template<typename PropertyWithEnumT> | 105 template<typename PropertyWithEnumT> |
100 MenuItem::Type GetType(const PropertyWithEnumT& property, | 106 MenuItem::Type GetType(const PropertyWithEnumT& property, |
101 MenuItem::Type default_type) { | 107 MenuItem::Type default_type) { |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 return false; | 308 return false; |
303 | 309 |
304 menu_manager->WriteToStorage(extension, item_id.extension_key); | 310 menu_manager->WriteToStorage(extension, item_id.extension_key); |
305 return true; | 311 return true; |
306 } | 312 } |
307 | 313 |
308 } // namespace context_menus_api_helpers | 314 } // namespace context_menus_api_helpers |
309 } // namespace extensions | 315 } // namespace extensions |
310 | 316 |
311 #endif // CHROME_BROWSER_EXTENSIONS_API_CONTEXT_MENUS_CONTEXT_MENUS_API_HELPERS
_H_ | 317 #endif // CHROME_BROWSER_EXTENSIONS_API_CONTEXT_MENUS_CONTEXT_MENUS_API_HELPERS
_H_ |
OLD | NEW |