| 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> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 // Alerts us that the theme changed, and we might need to change theme images. | 71 // Alerts us that the theme changed, and we might need to change theme images. |
| 72 void UserChangedTheme(GtkThemeProperties* properties); | 72 void UserChangedTheme(GtkThemeProperties* properties); |
| 73 | 73 |
| 74 // AnimationDelegate implementation ------------------------------------------ | 74 // AnimationDelegate implementation ------------------------------------------ |
| 75 virtual void AnimationProgressed(const Animation* animation); | 75 virtual void AnimationProgressed(const Animation* animation); |
| 76 virtual void AnimationEnded(const Animation* animation); | 76 virtual void AnimationEnded(const Animation* animation); |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 // Helper function which generates GtkToolItems for |bookmark_toolbar_|. | 79 // Helper function which generates GtkToolItems for |bookmark_toolbar_|. |
| 80 void CreateAllBookmarkButtons(const BookmarkNode* node); | 80 void CreateAllBookmarkButtons(); |
| 81 | 81 |
| 82 // Sets the visibility of the instructional text based on whether there are | 82 // Sets the visibility of the instructional text based on whether there are |
| 83 // any bookmarks in |node|. |node| is assumed to be the bookmarks bar node. | 83 // any bookmarks in the bookmark bar node. |
| 84 void SetInstructionState(const BookmarkNode* boomarks_bar_node); | 84 void SetInstructionState(); |
| 85 | 85 |
| 86 // Helper function which destroys all the bookmark buttons in the GtkToolbar. | 86 // Helper function which destroys all the bookmark buttons in the GtkToolbar. |
| 87 void RemoveAllBookmarkButtons(); | 87 void RemoveAllBookmarkButtons(); |
| 88 | 88 |
| 89 // Returns the number of buttons corresponding to starred urls/groups. This | 89 // Returns the number of buttons corresponding to starred urls/groups. This |
| 90 // is equivalent to the number of children the bookmark bar node from the | 90 // is equivalent to the number of children the bookmark bar node from the |
| 91 // bookmark bar model has. | 91 // bookmark bar model has. |
| 92 int GetBookmarkButtonCount(); | 92 int GetBookmarkButtonCount(); |
| 93 | 93 |
| 94 // Overridden from BookmarkModelObserver: | 94 // Overridden from BookmarkModelObserver: |
| 95 | 95 |
| 96 // Invoked when the bookmark bar model has finished loading. Creates a button | 96 // Invoked when the bookmark model has finished loading. Creates a button |
| 97 // for each of the children of the root node from the model. | 97 // for each of the children of the root node from the model. |
| 98 virtual void Loaded(BookmarkModel* model); | 98 virtual void Loaded(BookmarkModel* model); |
| 99 | 99 |
| 100 // Invoked when the model is being deleted. | 100 // Invoked when the model is being deleted. |
| 101 virtual void BookmarkModelBeingDeleted(BookmarkModel* model); | 101 virtual void BookmarkModelBeingDeleted(BookmarkModel* model); |
| 102 | 102 |
| 103 // Invoked when a node has moved. | 103 // Invoked when a node has moved. |
| 104 virtual void BookmarkNodeMoved(BookmarkModel* model, | 104 virtual void BookmarkNodeMoved(BookmarkModel* model, |
| 105 const BookmarkNode* old_parent, | 105 const BookmarkNode* old_parent, |
| 106 int old_index, | 106 int old_index, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 // A GtkLabel to display when there are no bookmark buttons to display. | 211 // A GtkLabel to display when there are no bookmark buttons to display. |
| 212 GtkWidget* instructions_; | 212 GtkWidget* instructions_; |
| 213 | 213 |
| 214 // GtkToolbar which contains all the bookmark buttons. | 214 // GtkToolbar which contains all the bookmark buttons. |
| 215 OwnedWidgetGtk bookmark_toolbar_; | 215 OwnedWidgetGtk bookmark_toolbar_; |
| 216 | 216 |
| 217 // The other bookmarks button. | 217 // The other bookmarks button. |
| 218 GtkWidget* other_bookmarks_button_; | 218 GtkWidget* other_bookmarks_button_; |
| 219 | 219 |
| 220 // The label inside |other_bookmarks_button_|. We keep a reference so we can | |
| 221 // change the text color. | |
| 222 GtkWidget* other_bookmarks_label_; | |
| 223 | |
| 224 // Whether we should ignore the next button release event (because we were | 220 // Whether we should ignore the next button release event (because we were |
| 225 // dragging). | 221 // dragging). |
| 226 bool ignore_button_release_; | 222 bool ignore_button_release_; |
| 227 | 223 |
| 228 // The BookmarkNode from the model being dragged. NULL when we aren't | 224 // The BookmarkNode from the model being dragged. NULL when we aren't |
| 229 // dragging. | 225 // dragging. |
| 230 const BookmarkNode* dragged_node_; | 226 const BookmarkNode* dragged_node_; |
| 231 | 227 |
| 232 // We create a GtkToolbarItem from |dragged_node_| for display. | 228 // We create a GtkToolbarItem from |dragged_node_| for display. |
| 233 GtkToolItem* toolbar_drop_item_; | 229 GtkToolItem* toolbar_drop_item_; |
| 234 | 230 |
| 235 // Whether we should show the instructional text in the bookmark bar. | 231 // Whether we should show the instructional text in the bookmark bar. |
| 236 bool show_instructions_; | 232 bool show_instructions_; |
| 237 | 233 |
| 238 // The last displayed right click menu, or NULL if no menus have been | 234 // The last displayed right click menu, or NULL if no menus have been |
| 239 // displayed yet. | 235 // displayed yet. |
| 240 scoped_ptr<BookmarkContextMenu> current_context_menu_; | 236 scoped_ptr<BookmarkContextMenu> current_context_menu_; |
| 241 | 237 |
| 242 // The last displayed left click menu, or NULL if no menus have been | 238 // The last displayed left click menu, or NULL if no menus have been |
| 243 // displayed yet. | 239 // displayed yet. |
| 244 scoped_ptr<BookmarkMenuController> current_menu_; | 240 scoped_ptr<BookmarkMenuController> current_menu_; |
| 245 | 241 |
| 246 // Paints the background for our bookmark bar. | 242 // Paints the background for our bookmark bar. |
| 247 scoped_ptr<NineBox> background_ninebox_; | 243 scoped_ptr<NineBox> background_ninebox_; |
| 248 | 244 |
| 249 scoped_ptr<SlideAnimation> slide_animation_; | 245 scoped_ptr<SlideAnimation> slide_animation_; |
| 250 }; | 246 }; |
| 251 | 247 |
| 252 #endif // CHROME_BROWSER_GTK_BOOKMARK_BAR_GTK_H_ | 248 #endif // CHROME_BROWSER_GTK_BOOKMARK_BAR_GTK_H_ |
| OLD | NEW |