OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_GTK_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
| 11 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "chrome/browser/bookmarks/base_bookmark_model_observer.h" | 13 #include "chrome/browser/bookmarks/base_bookmark_model_observer.h" |
13 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h" | 14 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h" |
14 #include "ui/base/glib/glib_integers.h" | 15 #include "ui/base/glib/glib_integers.h" |
15 #include "ui/base/gtk/gtk_signal.h" | 16 #include "ui/base/gtk/gtk_signal.h" |
16 #include "ui/base/gtk/gtk_signal_registrar.h" | 17 #include "ui/base/gtk/gtk_signal_registrar.h" |
17 #include "ui/base/gtk/owned_widget_gtk.h" | 18 #include "ui/base/gtk/owned_widget_gtk.h" |
18 #include "webkit/glue/window_open_disposition.h" | 19 #include "webkit/glue/window_open_disposition.h" |
19 | 20 |
20 class Profile; | 21 class Profile; |
(...skipping 23 matching lines...) Expand all Loading... |
44 | 45 |
45 // Pops up the menu. |widget| must be a GtkChromeButton. | 46 // Pops up the menu. |widget| must be a GtkChromeButton. |
46 void Popup(GtkWidget* widget, gint button_type, guint32 timestamp); | 47 void Popup(GtkWidget* widget, gint button_type, guint32 timestamp); |
47 | 48 |
48 // Overridden from BaseBookmarkModelObserver: | 49 // Overridden from BaseBookmarkModelObserver: |
49 virtual void BookmarkModelChanged() OVERRIDE; | 50 virtual void BookmarkModelChanged() OVERRIDE; |
50 virtual void BookmarkNodeFaviconChanged(BookmarkModel* model, | 51 virtual void BookmarkNodeFaviconChanged(BookmarkModel* model, |
51 const BookmarkNode* node) OVERRIDE; | 52 const BookmarkNode* node) OVERRIDE; |
52 | 53 |
53 // Overridden from BookmarkContextMenuController::Delegate: | 54 // Overridden from BookmarkContextMenuController::Delegate: |
54 virtual void WillExecuteCommand(); | 55 virtual void WillExecuteCommand() OVERRIDE; |
55 virtual void CloseMenu(); | 56 virtual void CloseMenu() OVERRIDE; |
56 | 57 |
57 private: | 58 private: |
58 // Recursively change the bookmark hierarchy rooted in |parent| into a set of | 59 // Recursively change the bookmark hierarchy rooted in |parent| into a set of |
59 // gtk menus rooted in |menu|. | 60 // gtk menus rooted in |menu|. |
60 void BuildMenu(const BookmarkNode* parent, | 61 void BuildMenu(const BookmarkNode* parent, |
61 int start_child_index, | 62 int start_child_index, |
62 GtkWidget* menu); | 63 GtkWidget* menu); |
63 | 64 |
64 // Calls the page navigator to navigate to the node represented by | 65 // Calls the page navigator to navigate to the node represented by |
65 // |menu_item|. | 66 // |menu_item|. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // The controller and view for the right click context menu. | 133 // The controller and view for the right click context menu. |
133 scoped_ptr<BookmarkContextMenuController> context_menu_controller_; | 134 scoped_ptr<BookmarkContextMenuController> context_menu_controller_; |
134 scoped_ptr<MenuGtk> context_menu_; | 135 scoped_ptr<MenuGtk> context_menu_; |
135 | 136 |
136 ui::GtkSignalRegistrar signals_; | 137 ui::GtkSignalRegistrar signals_; |
137 | 138 |
138 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); | 139 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); |
139 }; | 140 }; |
140 | 141 |
141 #endif // CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_GTK_H_ | 142 #endif // CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_GTK_H_ |
OLD | NEW |