| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TOOLBAR_WRENCH_MENU_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_MENU_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_MENU_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_MENU_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 namespace views { | 29 namespace views { |
| 30 class MenuButton; | 30 class MenuButton; |
| 31 struct MenuConfig; | 31 struct MenuConfig; |
| 32 class MenuItemView; | 32 class MenuItemView; |
| 33 class MenuRunner; | 33 class MenuRunner; |
| 34 class View; | 34 class View; |
| 35 } // namespace views | 35 } // namespace views |
| 36 | 36 |
| 37 // WrenchMenu adapts the WrenchMenuModel to view's menu related classes. | 37 // WrenchMenu adapts the WrenchMenuModel to view's menu related classes. |
| 38 class WrenchMenu : public views::MenuDelegate, | 38 class WrenchMenu : public views::MenuDelegate, |
| 39 public BaseBookmarkModelObserver, | 39 public bookmarks::BaseBookmarkModelObserver, |
| 40 public content::NotificationObserver { | 40 public content::NotificationObserver { |
| 41 public: | 41 public: |
| 42 enum RunFlags { | 42 enum RunFlags { |
| 43 // Indicates that the menu was opened for a drag-and-drop operation. | 43 // Indicates that the menu was opened for a drag-and-drop operation. |
| 44 FOR_DROP = 1 << 0, | 44 FOR_DROP = 1 << 0, |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 WrenchMenu(Browser* browser, int run_flags); | 47 WrenchMenu(Browser* browser, int run_flags); |
| 48 ~WrenchMenu() override; | 48 ~WrenchMenu() override; |
| 49 | 49 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 int GetMaxWidthForMenu(views::MenuItemView* menu) override; | 95 int GetMaxWidthForMenu(views::MenuItemView* menu) override; |
| 96 bool IsItemChecked(int command_id) const override; | 96 bool IsItemChecked(int command_id) const override; |
| 97 bool IsCommandEnabled(int command_id) const override; | 97 bool IsCommandEnabled(int command_id) const override; |
| 98 void ExecuteCommand(int command_id, int mouse_event_flags) override; | 98 void ExecuteCommand(int command_id, int mouse_event_flags) override; |
| 99 bool GetAccelerator(int command_id, | 99 bool GetAccelerator(int command_id, |
| 100 ui::Accelerator* accelerator) const override; | 100 ui::Accelerator* accelerator) const override; |
| 101 void WillShowMenu(views::MenuItemView* menu) override; | 101 void WillShowMenu(views::MenuItemView* menu) override; |
| 102 void WillHideMenu(views::MenuItemView* menu) override; | 102 void WillHideMenu(views::MenuItemView* menu) override; |
| 103 bool ShouldCloseOnDragComplete() override; | 103 bool ShouldCloseOnDragComplete() override; |
| 104 | 104 |
| 105 // BaseBookmarkModelObserver overrides: | 105 // bookmarks::BaseBookmarkModelObserver overrides: |
| 106 void BookmarkModelChanged() override; | 106 void BookmarkModelChanged() override; |
| 107 | 107 |
| 108 // content::NotificationObserver overrides: | 108 // content::NotificationObserver overrides: |
| 109 void Observe(int type, | 109 void Observe(int type, |
| 110 const content::NotificationSource& source, | 110 const content::NotificationSource& source, |
| 111 const content::NotificationDetails& details) override; | 111 const content::NotificationDetails& details) override; |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 class CutCopyPasteView; | 114 class CutCopyPasteView; |
| 115 class RecentTabsMenuModelDelegate; | 115 class RecentTabsMenuModelDelegate; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 ObserverList<WrenchMenuObserver> observer_list_; | 187 ObserverList<WrenchMenuObserver> observer_list_; |
| 188 | 188 |
| 189 // Records the time from when menu opens to when the user selects a menu item. | 189 // Records the time from when menu opens to when the user selects a menu item. |
| 190 base::ElapsedTimer menu_opened_timer_; | 190 base::ElapsedTimer menu_opened_timer_; |
| 191 | 191 |
| 192 DISALLOW_COPY_AND_ASSIGN(WrenchMenu); | 192 DISALLOW_COPY_AND_ASSIGN(WrenchMenu); |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_MENU_H_ | 195 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_MENU_H_ |
| OLD | NEW |