Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_GTK_BOOKMARK_BAR_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_BOOKMARK_BAR_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_BOOKMARK_BAR_GTK_H_ | 6 #define CHROME_BROWSER_GTK_BOOKMARK_BAR_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 class SlideAnimation; | 37 class SlideAnimation; |
| 38 class TabstripOriginProvider; | 38 class TabstripOriginProvider; |
| 39 | 39 |
| 40 class BookmarkBarGtk : public AnimationDelegate, | 40 class BookmarkBarGtk : public AnimationDelegate, |
| 41 public ProfileSyncServiceObserver, | 41 public ProfileSyncServiceObserver, |
| 42 public BookmarkModelObserver, | 42 public BookmarkModelObserver, |
| 43 public MenuBarHelper::Delegate, | 43 public MenuBarHelper::Delegate, |
| 44 public NotificationObserver, | 44 public NotificationObserver, |
| 45 public BookmarkBarInstructionsGtk::Delegate, | 45 public BookmarkBarInstructionsGtk::Delegate, |
| 46 public BookmarkContextMenuControllerDelegate { | 46 public BookmarkContextMenuControllerDelegate { |
| 47 FRIEND_TEST_ALL_PREFIXES(BookmarkBarGtkUnittest, DisplaysHelpMessageOnEmpty); | |
| 48 FRIEND_TEST_ALL_PREFIXES(BookmarkBarGtkUnittest, | |
| 49 HidesHelpMessageWithBookmark); | |
| 50 FRIEND_TEST_ALL_PREFIXES(BookmarkBarGtkUnittest, BuildsButtons); | |
| 51 public: | 47 public: |
| 52 explicit BookmarkBarGtk(BrowserWindowGtk* window, | 48 BookmarkBarGtk(BrowserWindowGtk* window, |
| 53 Profile* profile, Browser* browser, | 49 Profile* profile, |
| 54 TabstripOriginProvider* tabstrip_origin_provider); | 50 Browser* browser, |
| 51 TabstripOriginProvider* tabstrip_origin_provider); | |
| 55 virtual ~BookmarkBarGtk(); | 52 virtual ~BookmarkBarGtk(); |
| 56 | 53 |
| 57 // Resets the profile. This removes any buttons for the current profile and | 54 // Resets the profile. This removes any buttons for the current profile and |
| 58 // recreates the models. | 55 // recreates the models. |
| 59 void SetProfile(Profile* profile); | 56 void SetProfile(Profile* profile); |
| 60 | 57 |
| 61 // Returns the current profile. | 58 // Returns the current profile. |
| 62 Profile* GetProfile() { return profile_; } | 59 Profile* GetProfile() { return profile_; } |
| 63 | 60 |
| 64 // Returns the current browser. | 61 // Returns the current browser. |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 92 | 89 |
| 93 // Get the current height of the bookmark bar. | 90 // Get the current height of the bookmark bar. |
| 94 int GetHeight(); | 91 int GetHeight(); |
| 95 | 92 |
| 96 // Returns true if the bookmark bar is showing an animation. | 93 // Returns true if the bookmark bar is showing an animation. |
| 97 bool IsAnimating(); | 94 bool IsAnimating(); |
| 98 | 95 |
| 99 // Returns true if the bookmarks bar preference is set to 'always show'. | 96 // Returns true if the bookmarks bar preference is set to 'always show'. |
| 100 bool IsAlwaysShown(); | 97 bool IsAlwaysShown(); |
| 101 | 98 |
| 102 // AnimationDelegate implementation ------------------------------------------ | 99 // Overridden from AnimationDelegate: |
|
Evan Stade
2010/12/28 20:46:52
was there some decree I missed that this is the pr
tfarina
2010/12/28 20:51:14
Nope, I just use it everywhere. There are two othe
| |
| 103 virtual void AnimationProgressed(const Animation* animation); | 100 virtual void AnimationProgressed(const Animation* animation); |
| 104 virtual void AnimationEnded(const Animation* animation); | 101 virtual void AnimationEnded(const Animation* animation); |
| 105 | 102 |
| 106 // MenuBarHelper::Delegate implementation ------------------------------------ | 103 // Overridden from MenuBarHelper::Delegate: |
| 107 virtual void PopupForButton(GtkWidget* button); | 104 virtual void PopupForButton(GtkWidget* button); |
| 108 virtual void PopupForButtonNextTo(GtkWidget* button, | 105 virtual void PopupForButtonNextTo(GtkWidget* button, |
| 109 GtkMenuDirectionType dir); | 106 GtkMenuDirectionType dir); |
| 110 | 107 |
| 111 // The NTP needs to have access to this. | 108 // The NTP needs to have access to this. |
| 112 static const int kBookmarkBarNTPHeight; | 109 static const int kBookmarkBarNTPHeight; |
| 113 | 110 |
| 114 // BookmarkContextMenuController::Delegate implementation -------------------- | 111 // Overridden from BookmarkContextMenuController::Delegate: |
| 115 virtual void CloseMenu(); | 112 virtual void CloseMenu(); |
| 116 | 113 |
| 117 private: | 114 private: |
| 115 FRIEND_TEST_ALL_PREFIXES(BookmarkBarGtkUnittest, DisplaysHelpMessageOnEmpty); | |
| 116 FRIEND_TEST_ALL_PREFIXES(BookmarkBarGtkUnittest, | |
| 117 HidesHelpMessageWithBookmark); | |
| 118 FRIEND_TEST_ALL_PREFIXES(BookmarkBarGtkUnittest, BuildsButtons); | |
| 119 | |
| 118 // Helper function which generates GtkToolItems for |bookmark_toolbar_|. | 120 // Helper function which generates GtkToolItems for |bookmark_toolbar_|. |
| 119 void CreateAllBookmarkButtons(); | 121 void CreateAllBookmarkButtons(); |
| 120 | 122 |
| 121 // Sets the visibility of the instructional text based on whether there are | 123 // Sets the visibility of the instructional text based on whether there are |
| 122 // any bookmarks in the bookmark bar node. | 124 // any bookmarks in the bookmark bar node. |
| 123 void SetInstructionState(); | 125 void SetInstructionState(); |
| 124 | 126 |
| 125 // Sets the visibility of the overflow chevron. | 127 // Sets the visibility of the overflow chevron. |
| 126 void SetChevronState(); | 128 void SetChevronState(); |
| 127 | 129 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 387 gfx::Point last_pressed_coordinates_; | 389 gfx::Point last_pressed_coordinates_; |
| 388 | 390 |
| 389 // The currently throbbing widget. This is NULL if no widget is throbbing. | 391 // The currently throbbing widget. This is NULL if no widget is throbbing. |
| 390 // We track it because we only want to allow one widget to throb at a time. | 392 // We track it because we only want to allow one widget to throb at a time. |
| 391 GtkWidget* throbbing_widget_; | 393 GtkWidget* throbbing_widget_; |
| 392 | 394 |
| 393 ScopedRunnableMethodFactory<BookmarkBarGtk> method_factory_; | 395 ScopedRunnableMethodFactory<BookmarkBarGtk> method_factory_; |
| 394 }; | 396 }; |
| 395 | 397 |
| 396 #endif // CHROME_BROWSER_GTK_BOOKMARK_BAR_GTK_H_ | 398 #endif // CHROME_BROWSER_GTK_BOOKMARK_BAR_GTK_H_ |
| OLD | NEW |