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