OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEWS_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "components/bookmarks/core/browser/base_bookmark_model_observer.h" | 11 #include "components/bookmarks/core/browser/base_bookmark_model_observer.h" |
12 #include "components/bookmarks/core/browser/bookmark_node_data.h" | 12 #include "components/bookmarks/core/browser/bookmark_node_data.h" |
13 #include "ui/views/controls/menu/menu_delegate.h" | 13 #include "ui/views/controls/menu/menu_delegate.h" |
14 #include "ui/views/controls/menu/menu_item_view.h" | |
15 | 14 |
16 class BookmarkBarView; | 15 class BookmarkBarView; |
17 class BookmarkMenuControllerObserver; | 16 class BookmarkMenuControllerObserver; |
18 class BookmarkMenuDelegate; | 17 class BookmarkMenuDelegate; |
19 class BookmarkNode; | 18 class BookmarkNode; |
20 class Browser; | 19 class Browser; |
21 | 20 |
22 namespace content { | 21 namespace content { |
23 class PageNavigator; | 22 class PageNavigator; |
24 } | 23 } |
25 | 24 |
26 namespace ui { | 25 namespace ui { |
27 class OSExchangeData; | 26 class OSExchangeData; |
28 } | 27 } |
29 | 28 |
30 namespace views { | 29 namespace views { |
31 class MenuButton; | 30 class MenuButton; |
| 31 class MenuItemView; |
32 class MenuRunner; | 32 class MenuRunner; |
33 class Widget; | 33 class Widget; |
34 } | 34 } |
35 | 35 |
36 // BookmarkMenuController is responsible for showing a menu of bookmarks, | 36 // BookmarkMenuController is responsible for showing a menu of bookmarks, |
37 // each item in the menu represents a bookmark. | 37 // each item in the menu represents a bookmark. |
38 // BookmarkMenuController deletes itself as necessary, although the menu can | 38 // BookmarkMenuController deletes itself as necessary, although the menu can |
39 // be explicitly hidden by way of the Cancel method. | 39 // be explicitly hidden by way of the Cancel method. |
40 class BookmarkMenuController : public BaseBookmarkModelObserver, | 40 class BookmarkMenuController : public BaseBookmarkModelObserver, |
41 public views::MenuDelegate { | 41 public views::MenuDelegate { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 const gfx::Point& p, | 100 const gfx::Point& p, |
101 ui::MenuSourceType source_type) OVERRIDE; | 101 ui::MenuSourceType source_type) OVERRIDE; |
102 virtual void DropMenuClosed(views::MenuItemView* menu) OVERRIDE; | 102 virtual void DropMenuClosed(views::MenuItemView* menu) OVERRIDE; |
103 virtual bool CanDrag(views::MenuItemView* menu) OVERRIDE; | 103 virtual bool CanDrag(views::MenuItemView* menu) OVERRIDE; |
104 virtual void WriteDragData(views::MenuItemView* sender, | 104 virtual void WriteDragData(views::MenuItemView* sender, |
105 ui::OSExchangeData* data) OVERRIDE; | 105 ui::OSExchangeData* data) OVERRIDE; |
106 virtual int GetDragOperations(views::MenuItemView* sender) OVERRIDE; | 106 virtual int GetDragOperations(views::MenuItemView* sender) OVERRIDE; |
107 virtual views::MenuItemView* GetSiblingMenu( | 107 virtual views::MenuItemView* GetSiblingMenu( |
108 views::MenuItemView* menu, | 108 views::MenuItemView* menu, |
109 const gfx::Point& screen_point, | 109 const gfx::Point& screen_point, |
110 views::MenuItemView::AnchorPosition* anchor, | 110 views::MenuAnchorPosition* anchor, |
111 bool* has_mnemonics, | 111 bool* has_mnemonics, |
112 views::MenuButton** button) OVERRIDE; | 112 views::MenuButton** button) OVERRIDE; |
113 virtual int GetMaxWidthForMenu(views::MenuItemView* view) OVERRIDE; | 113 virtual int GetMaxWidthForMenu(views::MenuItemView* view) OVERRIDE; |
114 | 114 |
115 // BaseBookmarkModelObserver: | 115 // BaseBookmarkModelObserver: |
116 virtual void BookmarkModelChanged() OVERRIDE; | 116 virtual void BookmarkModelChanged() OVERRIDE; |
117 | 117 |
118 private: | 118 private: |
119 // BookmarkMenuController deletes itself as necessary. | 119 // BookmarkMenuController deletes itself as necessary. |
120 virtual ~BookmarkMenuController(); | 120 virtual ~BookmarkMenuController(); |
(...skipping 16 matching lines...) Expand all Loading... |
137 | 137 |
138 // The bookmark bar. This is only non-null if we're showing a menu item for a | 138 // The bookmark bar. This is only non-null if we're showing a menu item for a |
139 // folder on the bookmark bar and not for drop, or if the BookmarkBarView has | 139 // folder on the bookmark bar and not for drop, or if the BookmarkBarView has |
140 // been destroyed before the menu. | 140 // been destroyed before the menu. |
141 BookmarkBarView* bookmark_bar_; | 141 BookmarkBarView* bookmark_bar_; |
142 | 142 |
143 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); | 143 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); |
144 }; | 144 }; |
145 | 145 |
146 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ | 146 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ |
OLD | NEW |