Chromium Code Reviews| 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 ea5b94fe7b51138f79b9b5b207270d303924e503..565ef085fa268dd19e0f6d11a03a7835384d0c19 100644 |
| --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h |
| +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h |
| @@ -12,6 +12,7 @@ |
| #include "base/compiler_specific.h" |
| #include "base/gtest_prod_util.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "base/prefs/public/pref_change_registrar.h" |
| #include "chrome/browser/bookmarks/bookmark_model_observer.h" |
| #include "chrome/browser/bookmarks/bookmark_node_data.h" |
| #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
| @@ -249,6 +250,10 @@ class BookmarkBarView : public DetachableToolbarView, |
| friend class BookmarkBarViewEventTestBase; |
| FRIEND_TEST_ALL_PREFIXES(BookmarkBarViewTest, SwitchProfile); |
| + FRIEND_TEST_ALL_PREFIXES(BookmarkBarViewTest, |
| + NoAppsShortcutWithoutInstantExtended); |
| + FRIEND_TEST_ALL_PREFIXES(BookmarkBarViewInstantExtendedTest, |
| + AppsShortcutVisibility); |
| // Used to identify what the user is dropping onto. |
| enum DropButtonType { |
| @@ -289,6 +294,9 @@ class BookmarkBarView : public DetachableToolbarView, |
| // Creates the button for rendering the specified bookmark node. |
| views::View* CreateBookmarkButton(const BookmarkNode* node); |
| + // Creates the button for rendering the apps page shortcut. |
| + views::TextButton* CreateAppsPageShortcutButton(); |
| + |
| // Configures the button from the specified node. This sets the text, |
| // and icon. |
| void ConfigureButton(const BookmarkNode* node, views::TextButton* button); |
| @@ -351,6 +359,18 @@ class BookmarkBarView : public DetachableToolbarView, |
| // desired bounds. If |compute_bounds_only| = FALSE, the bounds are set. |
| gfx::Size LayoutItems(bool compute_bounds_only); |
| + // Returns true if we should show the apps shortcut. |
| + bool ShouldShowAppsShortcut() const; |
| + |
| + // Updates the visibility of the apps shortcut based on the pref value. |
| + void OnAppsPageShortcutVisibilityChanged(); |
| + |
| + // Used by tests. |
| + bool IsAppsShortcutVisibleForTesting() const; |
|
sky
2013/02/28 21:50:31
Since you're using a friend nuke this and check ap
beaudoin
2013/03/04 23:30:14
Done.
|
| + |
| + // Needed to react to kShowAppsShortcutInBookmarkBar changes. |
| + PrefChangeRegistrar profile_pref_registrar_; |
| + |
| // Used for opening urls. |
| content::PageNavigator* page_navigator_; |
| @@ -374,6 +394,9 @@ class BookmarkBarView : public DetachableToolbarView, |
| // Shows the other bookmark entries. |
| views::MenuButton* other_bookmarked_button_; |
| + // Shows the Apps page shortcut. |
| + views::TextButton* apps_page_shortcut_; |
| + |
| // Task used to delay showing of the drop menu. |
| base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_; |