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_VIEWS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ |
6 #define CHROME_BROWSER_VIEWS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ | 6 #define CHROME_BROWSER_VIEWS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/gfx/native_widget_types.h" | 10 #include "base/gfx/native_widget_types.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 class Observer { | 31 class Observer { |
32 public: | 32 public: |
33 virtual void BookmarkMenuDeleted(BookmarkMenuController* controller) = 0; | 33 virtual void BookmarkMenuDeleted(BookmarkMenuController* controller) = 0; |
34 }; | 34 }; |
35 | 35 |
36 // Creates a BookmarkMenuController showing the children of |node| starting | 36 // Creates a BookmarkMenuController showing the children of |node| starting |
37 // at index |start_child_index|. | 37 // at index |start_child_index|. |
38 BookmarkMenuController(Browser* browser, | 38 BookmarkMenuController(Browser* browser, |
39 Profile* profile, | 39 Profile* profile, |
40 PageNavigator* page_navigator, | 40 PageNavigator* page_navigator, |
41 gfx::NativeWindow parent, | 41 gfx::NativeView parent, |
42 BookmarkNode* node, | 42 BookmarkNode* node, |
43 int start_child_index, | 43 int start_child_index, |
44 bool show_other_folder); | 44 bool show_other_folder); |
45 | 45 |
46 // Shows the menu. | 46 // Shows the menu. |
47 void RunMenuAt(const gfx::Rect& bounds, | 47 void RunMenuAt(const gfx::Rect& bounds, |
48 views::MenuItemView::AnchorPosition position, | 48 views::MenuItemView::AnchorPosition position, |
49 bool for_drop); | 49 bool for_drop); |
50 | 50 |
51 // Hides the menu. | 51 // Hides the menu. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 views::MenuItemView* menu, | 103 views::MenuItemView* menu, |
104 int* next_menu_id); | 104 int* next_menu_id); |
105 | 105 |
106 Browser* browser_; | 106 Browser* browser_; |
107 | 107 |
108 Profile* profile_; | 108 Profile* profile_; |
109 | 109 |
110 PageNavigator* page_navigator_; | 110 PageNavigator* page_navigator_; |
111 | 111 |
112 // Parent of menus. | 112 // Parent of menus. |
113 gfx::NativeWindow parent_; | 113 gfx::NativeView parent_; |
114 | 114 |
115 // The node we're showing the contents of. | 115 // The node we're showing the contents of. |
116 BookmarkNode* node_; | 116 BookmarkNode* node_; |
117 | 117 |
118 // Maps from menu id to BookmarkNode. | 118 // Maps from menu id to BookmarkNode. |
119 std::map<int, BookmarkNode*> menu_id_to_node_map_; | 119 std::map<int, BookmarkNode*> menu_id_to_node_map_; |
120 | 120 |
121 // Mapping from node to menu id. This only contains entries for nodes of type | 121 // Mapping from node to menu id. This only contains entries for nodes of type |
122 // URL. | 122 // URL. |
123 std::map<BookmarkNode*, int> node_to_menu_id_map_; | 123 std::map<BookmarkNode*, int> node_to_menu_id_map_; |
(...skipping 13 matching lines...) Expand all Loading... |
137 // Is the menu being shown for a drop? | 137 // Is the menu being shown for a drop? |
138 bool for_drop_; | 138 bool for_drop_; |
139 | 139 |
140 // Should the other folder be shown? | 140 // Should the other folder be shown? |
141 bool show_other_folder_; | 141 bool show_other_folder_; |
142 | 142 |
143 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); | 143 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); |
144 }; | 144 }; |
145 | 145 |
146 #endif // CHROME_BROWSER_VIEWS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ | 146 #endif // CHROME_BROWSER_VIEWS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ |
OLD | NEW |