| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 void RemoveAllContextItems(std::string extension_id); | 233 void RemoveAllContextItems(std::string extension_id); |
| 234 | 234 |
| 235 // Returns the item with the given |id| or NULL. | 235 // Returns the item with the given |id| or NULL. |
| 236 ExtensionMenuItem* GetItemById(const ExtensionMenuItem::Id& id) const; | 236 ExtensionMenuItem* GetItemById(const ExtensionMenuItem::Id& id) const; |
| 237 | 237 |
| 238 // Called when a menu item is clicked on by the user. | 238 // Called when a menu item is clicked on by the user. |
| 239 void ExecuteCommand(Profile* profile, TabContents* tab_contents, | 239 void ExecuteCommand(Profile* profile, TabContents* tab_contents, |
| 240 const ContextMenuParams& params, | 240 const ContextMenuParams& params, |
| 241 const ExtensionMenuItem::Id& menuItemId); | 241 const ExtensionMenuItem::Id& menuItemId); |
| 242 | 242 |
| 243 // This returns a bitmap of width/height kFavIconSize, loaded either from an | 243 // This returns a bitmap of width/height kFaviconSize, loaded either from an |
| 244 // entry specified in the extension's 'icon' section of the manifest, or a | 244 // entry specified in the extension's 'icon' section of the manifest, or a |
| 245 // default extension icon. | 245 // default extension icon. |
| 246 const SkBitmap& GetIconForExtension(const std::string& extension_id); | 246 const SkBitmap& GetIconForExtension(const std::string& extension_id); |
| 247 | 247 |
| 248 // Implements the NotificationObserver interface. | 248 // Implements the NotificationObserver interface. |
| 249 virtual void Observe(NotificationType type, const NotificationSource& source, | 249 virtual void Observe(NotificationType type, const NotificationSource& source, |
| 250 const NotificationDetails& details); | 250 const NotificationDetails& details); |
| 251 | 251 |
| 252 // Returns true if |url| has an allowed scheme for extension context menu | 252 // Returns true if |url| has an allowed scheme for extension context menu |
| 253 // items. This checks against kAllowedSchemes. | 253 // items. This checks against kAllowedSchemes. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 275 std::map<ExtensionMenuItem::Id, ExtensionMenuItem*> items_by_id_; | 275 std::map<ExtensionMenuItem::Id, ExtensionMenuItem*> items_by_id_; |
| 276 | 276 |
| 277 NotificationRegistrar registrar_; | 277 NotificationRegistrar registrar_; |
| 278 | 278 |
| 279 ExtensionIconManager icon_manager_; | 279 ExtensionIconManager icon_manager_; |
| 280 | 280 |
| 281 DISALLOW_COPY_AND_ASSIGN(ExtensionMenuManager); | 281 DISALLOW_COPY_AND_ASSIGN(ExtensionMenuManager); |
| 282 }; | 282 }; |
| 283 | 283 |
| 284 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ | 284 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ |
| OLD | NEW |