Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.h

Issue 573893003: Avoid unnecessary visibility changes to BookmarkBarView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 2 trunk Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
index 8c072bdd2aa909672f969cfdda83c249a03a9dbe..0f12469f9807ee75c9b6555306fa2f9a08ac60b7 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
@@ -11,6 +11,7 @@
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
#include "base/prefs/pref_change_registrar.h"
#include "chrome/browser/bookmarks/bookmark_stats.h"
#include "chrome/browser/ui/bookmarks/bookmark_bar.h"
@@ -27,6 +28,7 @@
#include "ui/views/controls/menu/menu_types.h"
#include "ui/views/drag_controller.h"
+class BookmarkBarViewObserver;
class BookmarkContextMenu;
class BookmarkModel;
class Browser;
@@ -89,6 +91,9 @@ class BookmarkBarView : public DetachableToolbarView,
// Returns the current browser.
Browser* browser() const { return browser_; }
+ void AddObserver(BookmarkBarViewObserver* observer);
+ void RemoveObserver(BookmarkBarViewObserver* observer);
+
// Sets the PageNavigator that is used when the user selects an entry on
// the bookmark bar.
void SetPageNavigator(content::PageNavigator* navigator);
@@ -184,6 +189,7 @@ class BookmarkBarView : public DetachableToolbarView,
virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE;
virtual void OnThemeChanged() OVERRIDE;
virtual const char* GetClassName() const OVERRIDE;
+ virtual void SetVisible(bool visible) OVERRIDE;
// AccessiblePaneView:
virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
@@ -414,9 +420,6 @@ class BookmarkBarView : public DetachableToolbarView,
// Shows the Apps page shortcut.
views::LabelButton* apps_page_shortcut_;
- // Task used to delay showing of the drop menu.
- base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_;
-
// Used to track drops on the bookmark bar view.
scoped_ptr<DropInfo> drop_info_;
@@ -448,6 +451,11 @@ class BookmarkBarView : public DetachableToolbarView,
// Are we animating to or from the detached state?
bool animating_detached_;
+ ObserverList<BookmarkBarViewObserver> observers_;
+
+ // Factory used to delay showing of the drop menu.
+ base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_;
James Cook 2014/09/16 15:52:31 Hooray for WeakPtrFactory cleanup!
+
DISALLOW_COPY_AND_ASSIGN(BookmarkBarView);
};

Powered by Google App Engine
This is Rietveld 408576698