diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 19:10:22 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 19:10:22 +0000 |
commit | 7aa4c00e8f6464212974198b3a8a1bd4427fe53d (patch) | |
tree | 1f7b0b358e9e9e225df536ad268536b9e402561d /chrome/browser/views/bookmark_bar_view.h | |
parent | b3fb80902af2bbb14a755c9a77adb6c21d4987a3 (diff) | |
download | chromium_src-7aa4c00e8f6464212974198b3a8a1bd4427fe53d.zip chromium_src-7aa4c00e8f6464212974198b3a8a1bd4427fe53d.tar.gz chromium_src-7aa4c00e8f6464212974198b3a8a1bd4427fe53d.tar.bz2 |
Refactors code for showing bookmarks menus into a standalone class
that isn't tied to the bookmark bar. Removes some dead code from the
bookmark bar, and fixes a UMR in chrome_menu that I found when running
under purify. There isn't any behavior change in this patch.
BUG=none
TEST=this is a large refactoring of how bookmark menus are
shown. Please thoroughly test menus on the bookmark bar to make sure I
didn't screw anything up.
Review URL: http://codereview.chromium.org/42128
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/bookmark_bar_view.h')
-rw-r--r-- | chrome/browser/views/bookmark_bar_view.h | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.h b/chrome/browser/views/bookmark_bar_view.h index 5982fbf..8b42251 100644 --- a/chrome/browser/views/bookmark_bar_view.h +++ b/chrome/browser/views/bookmark_bar_view.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_VIEWS_BOOKMARK_BAR_VIEW_H_ #include "chrome/browser/bookmarks/bookmark_drag_data.h" +#include "chrome/browser/bookmarks/bookmark_menu_controller.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/common/slide_animation.h" @@ -44,8 +45,8 @@ class BookmarkBarView : public views::View, public NotificationObserver, public views::ContextMenuController, public views::DragController, - public AnimationDelegate { - friend class MenuRunner; + public AnimationDelegate, + public BookmarkMenuController::Observer { friend class ShowFolderMenuTask; public: @@ -153,6 +154,9 @@ class BookmarkBarView : public views::View, void AnimationProgressed(const Animation* animation); void AnimationEnded(const Animation* animation); + // BookmarkMenuController::Observer + virtual void BookmarkMenuDeleted(BookmarkMenuController* controller); + // Returns the button at the specified index. views::TextButton* GetBookmarkButton(int index); @@ -359,19 +363,6 @@ class BookmarkBarView : public views::View, bool* is_over_overflow, bool* is_over_other); - // Invokes CanDropAt to determine if this is a valid location for the data, - // then returns the appropriate drag operation based on the data. - int CalculateDropOperation(const views::DropTargetEvent& event, - const BookmarkDragData& data, - BookmarkNode* parent, - int index); - - // Performs a drop of the specified data at the specified location. Returns - // the result. - int PerformDropImpl(const BookmarkDragData& data, - BookmarkNode* parent_node, - int index); - // Returns the index of the first hidden bookmark button. If all buttons are // visible, this returns GetBookmarkButtonCount(). int GetFirstHiddenNodeIndex(); @@ -399,14 +390,14 @@ class BookmarkBarView : public views::View, // shown. This is owned by the Profile. BookmarkModel* model_; - // Used to manage showing a Menu: either for the most recently bookmarked + // Used to manage showing a Menu, either for the most recently bookmarked // entries, or for the a starred group. - scoped_ptr<MenuRunner> menu_runner_; + BookmarkMenuController* bookmark_menu_; // Used when showing a menu for drag and drop. That is, if the user drags - // over a group this becomes non-null and is the MenuRunner used to manage - // the menu showing the contents of the node. - scoped_ptr<MenuRunner> drop_menu_runner_; + // over a group this becomes non-null and manages the menu showing the + // contents of the node. + BookmarkMenuController* bookmark_drop_menu_; // Shows the other bookmark entries. views::MenuButton* other_bookmarked_button_; |