| OLD | NEW |
| 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 #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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // Returns the item with the given |id| or NULL. | 290 // Returns the item with the given |id| or NULL. |
| 291 ExtensionMenuItem* GetItemById(const ExtensionMenuItem::Id& id) const; | 291 ExtensionMenuItem* GetItemById(const ExtensionMenuItem::Id& id) const; |
| 292 | 292 |
| 293 // Notify the ExtensionMenuManager that an item has been updated not through | 293 // Notify the ExtensionMenuManager that an item has been updated not through |
| 294 // an explicit call into ExtensionMenuManager. For example, if an item is | 294 // an explicit call into ExtensionMenuManager. For example, if an item is |
| 295 // acquired by a call to GetItemById and changed, then this should be called. | 295 // acquired by a call to GetItemById and changed, then this should be called. |
| 296 // Returns true if the item was found or false otherwise. | 296 // Returns true if the item was found or false otherwise. |
| 297 bool ItemUpdated(const ExtensionMenuItem::Id& id); | 297 bool ItemUpdated(const ExtensionMenuItem::Id& id); |
| 298 | 298 |
| 299 // Called when a menu item is clicked on by the user. | 299 // Called when a menu item is clicked on by the user. |
| 300 void ExecuteCommand(Profile* profile, content::WebContents* web_contents, | 300 void ExecuteCommand(Profile* profile, |
| 301 content::WebContents* web_contents, |
| 301 const content::ContextMenuParams& params, | 302 const content::ContextMenuParams& params, |
| 302 const ExtensionMenuItem::Id& menuItemId); | 303 const ExtensionMenuItem::Id& menu_item_id); |
| 303 | 304 |
| 304 // This returns a bitmap of width/height kFaviconSize, loaded either from an | 305 // This returns a bitmap of width/height kFaviconSize, loaded either from an |
| 305 // entry specified in the extension's 'icon' section of the manifest, or a | 306 // entry specified in the extension's 'icon' section of the manifest, or a |
| 306 // default extension icon. | 307 // default extension icon. |
| 307 const SkBitmap& GetIconForExtension(const std::string& extension_id); | 308 const SkBitmap& GetIconForExtension(const std::string& extension_id); |
| 308 | 309 |
| 309 // Implements the content::NotificationObserver interface. | 310 // Implements the content::NotificationObserver interface. |
| 310 virtual void Observe(int type, const content::NotificationSource& source, | 311 virtual void Observe(int type, const content::NotificationSource& source, |
| 311 const content::NotificationDetails& details) OVERRIDE; | 312 const content::NotificationDetails& details) OVERRIDE; |
| 312 | 313 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 content::NotificationRegistrar registrar_; | 349 content::NotificationRegistrar registrar_; |
| 349 | 350 |
| 350 ExtensionIconManager icon_manager_; | 351 ExtensionIconManager icon_manager_; |
| 351 | 352 |
| 352 Profile* profile_; | 353 Profile* profile_; |
| 353 | 354 |
| 354 DISALLOW_COPY_AND_ASSIGN(ExtensionMenuManager); | 355 DISALLOW_COPY_AND_ASSIGN(ExtensionMenuManager); |
| 355 }; | 356 }; |
| 356 | 357 |
| 357 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ | 358 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ |
| OLD | NEW |