Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Side by Side Diff: chrome/browser/gtk/bookmark_menu_controller_gtk.h

Issue 261013: Renames browser/gtk/bookmark_context_menu to... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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>
11 11
12 #include "base/scoped_ptr.h" 12 #include "base/scoped_ptr.h"
13 #include "chrome/browser/bookmarks/base_bookmark_model_observer.h" 13 #include "chrome/browser/bookmarks/base_bookmark_model_observer.h"
14 #include "chrome/browser/gtk/bookmark_context_menu.h" 14 #include "chrome/browser/gtk/bookmark_context_menu_gtk.h"
15 #include "chrome/common/owned_widget_gtk.h" 15 #include "chrome/common/owned_widget_gtk.h"
16 #include "webkit/glue/window_open_disposition.h" 16 #include "webkit/glue/window_open_disposition.h"
17 17
18 class Browser; 18 class Browser;
19 class Profile; 19 class Profile;
20 class Profiler; 20 class Profiler;
21 class PageNavigator; 21 class PageNavigator;
22 class BookmarkModel; 22 class BookmarkModel;
23 class BookmarkNode; 23 class BookmarkNode;
24 24
25 class BookmarkMenuController : public BaseBookmarkModelObserver, 25 class BookmarkMenuController : public BaseBookmarkModelObserver,
26 public BookmarkContextMenu::Delegate { 26 public BookmarkContextMenuGtk::Delegate {
27 public: 27 public:
28 // Creates a BookmarkMenuController showing the children of |node| starting 28 // Creates a BookmarkMenuController showing the children of |node| starting
29 // at index |start_child_index|. 29 // at index |start_child_index|.
30 BookmarkMenuController(Browser* browser, 30 BookmarkMenuController(Browser* browser,
31 Profile* profile, 31 Profile* profile,
32 PageNavigator* page_navigator, 32 PageNavigator* page_navigator,
33 GtkWindow* window, 33 GtkWindow* window,
34 const BookmarkNode* node, 34 const BookmarkNode* node,
35 int start_child_index, 35 int start_child_index,
36 bool show_other_folder); 36 bool show_other_folder);
37 virtual ~BookmarkMenuController(); 37 virtual ~BookmarkMenuController();
38 38
39 GtkWidget* widget() { return menu_; } 39 GtkWidget* widget() { return menu_; }
40 40
41 // Pops up the menu. |widget| must be a GtkChromeButton. 41 // Pops up the menu. |widget| must be a GtkChromeButton.
42 void Popup(GtkWidget* widget, gint button_type, guint32 timestamp); 42 void Popup(GtkWidget* widget, gint button_type, guint32 timestamp);
43 43
44 // Overridden from BaseBookmarkModelObserver: 44 // Overridden from BaseBookmarkModelObserver:
45 virtual void BookmarkModelChanged(); 45 virtual void BookmarkModelChanged();
46 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, 46 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model,
47 const BookmarkNode* node); 47 const BookmarkNode* node);
48 48
49 // Overridden from BookmarkContextMenu::Delegate: 49 // Overridden from BookmarkContextMenuGtk::Delegate:
50 virtual void WillExecuteCommand(); 50 virtual void WillExecuteCommand();
51 51
52 private: 52 private:
53 // Recursively change the bookmark hierarchy rooted in |parent| into a set of 53 // Recursively change the bookmark hierarchy rooted in |parent| into a set of
54 // gtk menus rooted in |menu|. 54 // gtk menus rooted in |menu|.
55 void BuildMenu(const BookmarkNode* parent, 55 void BuildMenu(const BookmarkNode* parent,
56 int start_child_index, 56 int start_child_index,
57 GtkWidget* menu); 57 GtkWidget* menu);
58 58
59 // Calls the page navigator to navigate to the node represented by 59 // Calls the page navigator to navigate to the node represented by
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 bool ignore_button_release_; 117 bool ignore_button_release_;
118 118
119 // The widget we are showing for (i.e. the bookmark bar folder button). 119 // The widget we are showing for (i.e. the bookmark bar folder button).
120 GtkWidget* triggering_widget_; 120 GtkWidget* triggering_widget_;
121 121
122 // Mapping from node to GtkMenuItem menu id. This only contains entries for 122 // Mapping from node to GtkMenuItem menu id. This only contains entries for
123 // nodes of type URL. 123 // nodes of type URL.
124 std::map<const BookmarkNode*, GtkWidget*> node_to_menu_widget_map_; 124 std::map<const BookmarkNode*, GtkWidget*> node_to_menu_widget_map_;
125 125
126 // Owns our right click context menu. 126 // Owns our right click context menu.
127 scoped_ptr<BookmarkContextMenu> context_menu_; 127 scoped_ptr<BookmarkContextMenuGtk> context_menu_;
128 128
129 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); 129 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController);
130 }; 130 };
131 131
132 #endif // CHROME_BROWSER_GTK_BOOKMARK_MENU_CONTROLLER_GTK_H_ 132 #endif // CHROME_BROWSER_GTK_BOOKMARK_MENU_CONTROLLER_GTK_H_
OLDNEW
« no previous file with comments | « chrome/browser/gtk/bookmark_manager_gtk.cc ('k') | chrome/browser/gtk/bookmark_menu_controller_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698