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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 const BookmarkNode* parent, | 113 const BookmarkNode* parent, |
114 int index); | 114 int index); |
115 virtual void BookmarkNodeChanged(BookmarkModel* model, | 115 virtual void BookmarkNodeChanged(BookmarkModel* model, |
116 const BookmarkNode* node); | 116 const BookmarkNode* node); |
117 // Invoked when a favicon has finished loading. | 117 // Invoked when a favicon has finished loading. |
118 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, | 118 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, |
119 const BookmarkNode* node); | 119 const BookmarkNode* node); |
120 virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, | 120 virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, |
121 const BookmarkNode* node); | 121 const BookmarkNode* node); |
122 | 122 |
123 private: | |
124 GtkWidget* CreateBookmarkButton(const BookmarkNode* node); | 123 GtkWidget* CreateBookmarkButton(const BookmarkNode* node); |
125 GtkToolItem* CreateBookmarkToolItem(const BookmarkNode* node); | 124 GtkToolItem* CreateBookmarkToolItem(const BookmarkNode* node); |
126 | 125 |
127 void ConnectFolderButtonEvents(GtkWidget* widget); | 126 void ConnectFolderButtonEvents(GtkWidget* widget); |
128 | 127 |
129 // Finds the BookmarkNode from the model associated with |button|. | 128 // Finds the BookmarkNode from the model associated with |button|. |
130 const BookmarkNode* GetNodeForToolButton(GtkWidget* button); | 129 const BookmarkNode* GetNodeForToolButton(GtkWidget* button); |
131 | 130 |
132 // Loads the background image into memory, or does nothing if already loaded. | 131 // Loads the background image into memory, or does nothing if already loaded. |
133 void InitBackground(); | 132 void InitBackground(); |
(...skipping 17 matching lines...) Expand all Loading... |
151 BookmarkBarGtk* bar); | 150 BookmarkBarGtk* bar); |
152 static void OnButtonDragGet(GtkWidget* widget, GdkDragContext* context, | 151 static void OnButtonDragGet(GtkWidget* widget, GdkDragContext* context, |
153 GtkSelectionData* selection_data, | 152 GtkSelectionData* selection_data, |
154 guint target_type, guint time, | 153 guint target_type, guint time, |
155 BookmarkBarGtk* bar); | 154 BookmarkBarGtk* bar); |
156 | 155 |
157 // GtkButton callbacks for folder buttons | 156 // GtkButton callbacks for folder buttons |
158 static gboolean OnFolderButtonReleased(GtkWidget* sender, | 157 static gboolean OnFolderButtonReleased(GtkWidget* sender, |
159 GdkEventButton* event, | 158 GdkEventButton* event, |
160 BookmarkBarGtk* bar); | 159 BookmarkBarGtk* bar); |
| 160 static void OnFolderDragReceived(GtkWidget* widget, |
| 161 GdkDragContext* context, |
| 162 gint x, gint y, |
| 163 GtkSelectionData* selection_data, |
| 164 guint target_type, guint time, |
| 165 BookmarkBarGtk* bar); |
161 | 166 |
162 // GtkToolbar callbacks | 167 // GtkToolbar callbacks |
163 static gboolean OnToolbarExpose(GtkWidget* widget, GdkEventExpose* event, | 168 static gboolean OnToolbarExpose(GtkWidget* widget, GdkEventExpose* event, |
164 BookmarkBarGtk* window); | 169 BookmarkBarGtk* window); |
165 static gboolean OnToolbarDragMotion(GtkToolbar* toolbar, | 170 static gboolean OnToolbarDragMotion(GtkToolbar* toolbar, |
166 GdkDragContext* context, | 171 GdkDragContext* context, |
167 gint x, | 172 gint x, |
168 gint y, | 173 gint y, |
169 guint time, | 174 guint time, |
170 BookmarkBarGtk* bar); | 175 BookmarkBarGtk* bar); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // displayed yet. | 243 // displayed yet. |
239 scoped_ptr<BookmarkMenuController> current_menu_; | 244 scoped_ptr<BookmarkMenuController> current_menu_; |
240 | 245 |
241 // Paints the background for our bookmark bar. | 246 // Paints the background for our bookmark bar. |
242 scoped_ptr<NineBox> background_ninebox_; | 247 scoped_ptr<NineBox> background_ninebox_; |
243 | 248 |
244 scoped_ptr<SlideAnimation> slide_animation_; | 249 scoped_ptr<SlideAnimation> slide_animation_; |
245 }; | 250 }; |
246 | 251 |
247 #endif // CHROME_BROWSER_GTK_BOOKMARK_BAR_GTK_H_ | 252 #endif // CHROME_BROWSER_GTK_BOOKMARK_BAR_GTK_H_ |
OLD | NEW |