| 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 16 matching lines...) Expand all Loading... |
| 27 return scoped_ptr<extensions::MenuItem::Id>(); | 27 return scoped_ptr<extensions::MenuItem::Id>(); |
| 28 | 28 |
| 29 scoped_ptr<extensions::MenuItem::Id> parent_id( | 29 scoped_ptr<extensions::MenuItem::Id> parent_id( |
| 30 new extensions::MenuItem::Id(is_off_the_record, key)); | 30 new extensions::MenuItem::Id(is_off_the_record, key)); |
| 31 if (property.parent_id->as_integer) | 31 if (property.parent_id->as_integer) |
| 32 parent_id->uid = *property.parent_id->as_integer; | 32 parent_id->uid = *property.parent_id->as_integer; |
| 33 else if (property.parent_id->as_string) | 33 else if (property.parent_id->as_string) |
| 34 parent_id->string_uid = *property.parent_id->as_string; | 34 parent_id->string_uid = *property.parent_id->as_string; |
| 35 else | 35 else |
| 36 NOTREACHED(); | 36 NOTREACHED(); |
| 37 return parent_id.Pass(); | 37 return parent_id; |
| 38 } | 38 } |
| 39 | 39 |
| 40 } // namespace | 40 } // namespace |
| 41 | 41 |
| 42 extern const char kActionNotAllowedError[]; | 42 extern const char kActionNotAllowedError[]; |
| 43 extern const char kCannotFindItemError[]; | 43 extern const char kCannotFindItemError[]; |
| 44 extern const char kCheckedError[]; | 44 extern const char kCheckedError[]; |
| 45 extern const char kDuplicateIDError[]; | 45 extern const char kDuplicateIDError[]; |
| 46 extern const char kGeneratedIdKey[]; | 46 extern const char kGeneratedIdKey[]; |
| 47 extern const char kLauncherNotAllowedError[]; | 47 extern const char kLauncherNotAllowedError[]; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 return false; | 258 return false; |
| 259 | 259 |
| 260 menu_manager->WriteToStorage(extension, item_id.extension_key); | 260 menu_manager->WriteToStorage(extension, item_id.extension_key); |
| 261 return true; | 261 return true; |
| 262 } | 262 } |
| 263 | 263 |
| 264 } // namespace context_menus_api_helpers | 264 } // namespace context_menus_api_helpers |
| 265 } // namespace extensions | 265 } // namespace extensions |
| 266 | 266 |
| 267 #endif // CHROME_BROWSER_EXTENSIONS_API_CONTEXT_MENUS_CONTEXT_MENUS_API_HELPERS
_H_ | 267 #endif // CHROME_BROWSER_EXTENSIONS_API_CONTEXT_MENUS_CONTEXT_MENUS_API_HELPERS
_H_ |
| OLD | NEW |