diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 06:46:10 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 06:46:10 +0000 |
commit | 4930760d08e0d3afef5e99684fc7450b15d0cf78 (patch) | |
tree | d4d02e538c145096e8ba74bc8cb34a72a6d83647 /chrome/browser/extensions/extension_menu_manager.h | |
parent | 022a8ca1d96755b98c26c6211968415fe7c2f458 (diff) | |
download | chromium_src-4930760d08e0d3afef5e99684fc7450b15d0cf78.zip chromium_src-4930760d08e0d3afef5e99684fc7450b15d0cf78.tar.gz chromium_src-4930760d08e0d3afef5e99684fc7450b15d0cf78.tar.bz2 |
Revert r50779 as it breaks memory tests
TBR=asargent@chromium.org
TEST=Tree goes green
Review URL: http://codereview.chromium.org/2812025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50828 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_menu_manager.h')
-rw-r--r-- | chrome/browser/extensions/extension_menu_manager.h | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/chrome/browser/extensions/extension_menu_manager.h b/chrome/browser/extensions/extension_menu_manager.h index c3f82c5..e85f5d5 100644 --- a/chrome/browser/extensions/extension_menu_manager.h +++ b/chrome/browser/extensions/extension_menu_manager.h @@ -14,14 +14,11 @@ #include "base/linked_ptr.h" #include "base/stl_util-inl.h" #include "base/string16.h" -#include "chrome/browser/extensions/image_loading_tracker.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" -#include "third_party/skia/include/core/SkBitmap.h" struct ContextMenuParams; -class Extension; class ExtensionMessageService; class Profile; class TabContents; @@ -170,9 +167,7 @@ class ExtensionMenuItem { }; // This class keeps track of menu items added by extensions. -class ExtensionMenuManager - : public ImageLoadingTracker::Observer, - public NotificationObserver { +class ExtensionMenuManager : public NotificationObserver { public: ExtensionMenuManager(); virtual ~ExtensionMenuManager(); @@ -187,11 +182,9 @@ class ExtensionMenuManager // put them into a submenu if there are more than 1. const ExtensionMenuItem::List* MenuItems(const std::string& extension_id); - // Adds a top-level menu item for an extension, requiring the |extension| - // pointer so it can load the icon for the extension. Takes ownership of - // |item|. Returns the id assigned to the item. Has the side-effect of - // incrementing the next_item_id_ member. - int AddContextItem(Extension* extension, ExtensionMenuItem* item); + // Takes ownership of |item|. Returns the id assigned to the item. Has the + // side-effect of incrementing the next_item_id_ member. + int AddContextItem(ExtensionMenuItem* item); // Add an item as a child of another item which has been previously added, and // takes ownership of |item|. Returns the id assigned to the item, or 0 on @@ -224,15 +217,6 @@ class ExtensionMenuManager virtual void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details); - // This returns a bitmap of width/height kFavIconSize, loaded either from an - // entry specified in the extension's 'icon' section of the manifest, or a - // default extension icon. - const SkBitmap& GetIconForExtension(const std::string& extension_id); - - // Implements the ImageLoadingTracker::Observer interface. - virtual void OnImageLoaded(SkBitmap* image, ExtensionResource resource, - int index); - private: // This is a helper function which takes care of de-selecting any other radio // items in the same group (i.e. that are adjacent in the list). @@ -241,13 +225,6 @@ class ExtensionMenuManager // Returns true if item is a descendant of an item with id |ancestor_id|. bool DescendantOf(ExtensionMenuItem* item, int ancestor_id); - // Makes sure we've done one-time initialization of the default extension icon - // default_icon_. - void EnsureDefaultIcon(); - - // Helper function to return a copy of |src| scaled to kFavIconSize. - SkBitmap ScaleToFavIconSize(const SkBitmap& src); - // We keep items organized by mapping an extension id to a list of items. typedef std::map<std::string, ExtensionMenuItem::List> MenuItemMap; MenuItemMap context_items_; @@ -262,15 +239,6 @@ class ExtensionMenuManager NotificationRegistrar registrar_; - // Used for loading extension icons. - ImageLoadingTracker image_tracker_; - - // Maps extension id to an SkBitmap with the icon for that extension. - std::map<std::string, SkBitmap> extension_icons_; - - // The default icon we'll use if an extension doesn't have one. - SkBitmap default_icon_; - DISALLOW_COPY_AND_ASSIGN(ExtensionMenuManager); }; |