| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "app/slide_animation.h" |
| 13 #include "chrome/common/owned_widget_gtk.h" | 14 #include "chrome/common/owned_widget_gtk.h" |
| 14 #include "chrome/browser/bookmarks/bookmark_model.h" | 15 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 15 | 16 |
| 16 class BookmarkContextMenu; | 17 class BookmarkContextMenu; |
| 17 class BookmarkMenuController; | 18 class BookmarkMenuController; |
| 18 class Browser; | 19 class Browser; |
| 19 class CustomContainerButton; | 20 class CustomContainerButton; |
| 20 class NineBox; | 21 class NineBox; |
| 21 class PageNavigator; | 22 class PageNavigator; |
| 22 class Profile; | 23 class Profile; |
| 23 | 24 |
| 24 class BookmarkBarGtk : public BookmarkModelObserver { | 25 class BookmarkBarGtk : public AnimationDelegate, |
| 26 public BookmarkModelObserver { |
| 25 public: | 27 public: |
| 26 explicit BookmarkBarGtk(Profile* proifle, Browser* browser); | 28 explicit BookmarkBarGtk(Profile* proifle, Browser* browser); |
| 27 virtual ~BookmarkBarGtk(); | 29 virtual ~BookmarkBarGtk(); |
| 28 | 30 |
| 29 // Resets the profile. This removes any buttons for the current profile and | 31 // Resets the profile. This removes any buttons for the current profile and |
| 30 // recreates the models. | 32 // recreates the models. |
| 31 void SetProfile(Profile* profile); | 33 void SetProfile(Profile* profile); |
| 32 | 34 |
| 33 // Returns the current profile. | 35 // Returns the current profile. |
| 34 Profile* GetProfile() { return profile_; } | 36 Profile* GetProfile() { return profile_; } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 51 bool OnNewTabPage(); | 53 bool OnNewTabPage(); |
| 52 | 54 |
| 53 // Change the visibility of the bookmarks bar. (Starts out hidden, per GTK's | 55 // Change the visibility of the bookmarks bar. (Starts out hidden, per GTK's |
| 54 // default behaviour). | 56 // default behaviour). |
| 55 void Show(); | 57 void Show(); |
| 56 void Hide(); | 58 void Hide(); |
| 57 | 59 |
| 58 // Returns true if the bookmarks bar preference is set to 'always show'. | 60 // Returns true if the bookmarks bar preference is set to 'always show'. |
| 59 bool IsAlwaysShown(); | 61 bool IsAlwaysShown(); |
| 60 | 62 |
| 63 // AnimationDelegate implementation ------------------------------------------ |
| 64 virtual void AnimationProgressed(const Animation* animation); |
| 65 virtual void AnimationEnded(const Animation* animation); |
| 66 |
| 61 private: | 67 private: |
| 62 // Helper function that sets visual properties of GtkButton |button| to the | 68 // Helper function that sets visual properties of GtkButton |button| to the |
| 63 // contents of |node|. | 69 // contents of |node|. |
| 64 void ConfigureButtonForNode(BookmarkNode* node, | 70 void ConfigureButtonForNode(BookmarkNode* node, |
| 65 GtkWidget* button); | 71 GtkWidget* button); |
| 66 | 72 |
| 67 // Helper function which generates GtkToolItems for |bookmark_toolbar_|. | 73 // Helper function which generates GtkToolItems for |bookmark_toolbar_|. |
| 68 void CreateAllBookmarkButtons(BookmarkNode* node); | 74 void CreateAllBookmarkButtons(BookmarkNode* node); |
| 69 | 75 |
| 70 // Sets the visibility of the instructional text based on whether there are | 76 // Sets the visibility of the instructional text based on whether there are |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // The last displayed right click menu, or NULL if no menus have been | 224 // The last displayed right click menu, or NULL if no menus have been |
| 219 // displayed yet. | 225 // displayed yet. |
| 220 scoped_ptr<BookmarkContextMenu> current_context_menu_; | 226 scoped_ptr<BookmarkContextMenu> current_context_menu_; |
| 221 | 227 |
| 222 // The last displayed left click menu, or NULL if no menus have been | 228 // The last displayed left click menu, or NULL if no menus have been |
| 223 // displayed yet. | 229 // displayed yet. |
| 224 scoped_ptr<BookmarkMenuController> current_menu_; | 230 scoped_ptr<BookmarkMenuController> current_menu_; |
| 225 | 231 |
| 226 // Paints the background for our bookmark bar. | 232 // Paints the background for our bookmark bar. |
| 227 scoped_ptr<NineBox> background_ninebox_; | 233 scoped_ptr<NineBox> background_ninebox_; |
| 234 |
| 235 scoped_ptr<SlideAnimation> slide_animation_; |
| 228 }; | 236 }; |
| 229 | 237 |
| 230 #endif // CHROME_BROWSER_GTK_BOOKMARK_BAR_GTK_H_ | 238 #endif // CHROME_BROWSER_GTK_BOOKMARK_BAR_GTK_H_ |
| OLD | NEW |