| 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_MENU_CONTROLLER_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_BOOKMARK_MENU_CONTROLLER_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_BOOKMARK_MENU_CONTROLLER_GTK_H_ | 6 #define CHROME_BROWSER_GTK_BOOKMARK_MENU_CONTROLLER_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // at index |start_child_index|. | 28 // at index |start_child_index|. |
| 29 BookmarkMenuController(Browser* browser, | 29 BookmarkMenuController(Browser* browser, |
| 30 Profile* profile, | 30 Profile* profile, |
| 31 PageNavigator* page_navigator, | 31 PageNavigator* page_navigator, |
| 32 GtkWindow* window, | 32 GtkWindow* window, |
| 33 const BookmarkNode* node, | 33 const BookmarkNode* node, |
| 34 int start_child_index, | 34 int start_child_index, |
| 35 bool show_other_folder); | 35 bool show_other_folder); |
| 36 virtual ~BookmarkMenuController(); | 36 virtual ~BookmarkMenuController(); |
| 37 | 37 |
| 38 GtkWidget* widget() { return menu_; } |
| 39 |
| 38 // Pops up the menu. |widget| must be a GtkChromeButton. | 40 // Pops up the menu. |widget| must be a GtkChromeButton. |
| 39 void Popup(GtkWidget* widget, gint button_type, guint32 timestamp); | 41 void Popup(GtkWidget* widget, gint button_type, guint32 timestamp); |
| 40 | 42 |
| 41 // Overridden from BaseBookmarkModelObserver: | 43 // Overridden from BaseBookmarkModelObserver: |
| 42 virtual void BookmarkModelChanged(); | 44 virtual void BookmarkModelChanged(); |
| 43 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, | 45 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, |
| 44 const BookmarkNode* node); | 46 const BookmarkNode* node); |
| 45 | 47 |
| 46 private: | 48 private: |
| 47 // Recursively change the bookmark hierarchy rooted in |parent| into a set of | 49 // Recursively change the bookmark hierarchy rooted in |parent| into a set of |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // The bookmark model. | 99 // The bookmark model. |
| 98 BookmarkModel* model_; | 100 BookmarkModel* model_; |
| 99 | 101 |
| 100 // The node we're showing the contents of. | 102 // The node we're showing the contents of. |
| 101 const BookmarkNode* node_; | 103 const BookmarkNode* node_; |
| 102 | 104 |
| 103 // Our bookmark menus. We don't use the MenuGtk class because we have to do | 105 // Our bookmark menus. We don't use the MenuGtk class because we have to do |
| 104 // all sorts of weird non-standard things with this menu, like: | 106 // all sorts of weird non-standard things with this menu, like: |
| 105 // - The menu is a drag target | 107 // - The menu is a drag target |
| 106 // - The menu items have context menus. | 108 // - The menu items have context menus. |
| 107 OwnedWidgetGtk menu_; | 109 GtkWidget* menu_; |
| 108 | 110 |
| 109 // Whether we should ignore the next button release event (because we were | 111 // Whether we should ignore the next button release event (because we were |
| 110 // dragging). | 112 // dragging). |
| 111 bool ignore_button_release_; | 113 bool ignore_button_release_; |
| 112 | 114 |
| 113 // The widget we are showing for (i.e. the bookmark bar folder button). | 115 // The widget we are showing for (i.e. the bookmark bar folder button). |
| 114 GtkWidget* triggering_widget_; | 116 GtkWidget* triggering_widget_; |
| 115 | 117 |
| 116 // Mapping from node to GtkMenuItem menu id. This only contains entries for | 118 // Mapping from node to GtkMenuItem menu id. This only contains entries for |
| 117 // nodes of type URL. | 119 // nodes of type URL. |
| 118 std::map<const BookmarkNode*, GtkWidget*> node_to_menu_widget_map_; | 120 std::map<const BookmarkNode*, GtkWidget*> node_to_menu_widget_map_; |
| 119 | 121 |
| 120 // Owns our right click context menu. | 122 // Owns our right click context menu. |
| 121 scoped_ptr<BookmarkContextMenu> context_menu_; | 123 scoped_ptr<BookmarkContextMenu> context_menu_; |
| 122 | 124 |
| 123 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); | 125 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); |
| 124 }; | 126 }; |
| 125 | 127 |
| 126 #endif // CHROME_BROWSER_GTK_BOOKMARK_MENU_CONTROLLER_GTK_H_ | 128 #endif // CHROME_BROWSER_GTK_BOOKMARK_MENU_CONTROLLER_GTK_H_ |
| OLD | NEW |