| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 // Whether the menu is currently visible to the user. | 56 // Whether the menu is currently visible to the user. |
| 57 bool IsShowing(); | 57 bool IsShowing(); |
| 58 | 58 |
| 59 bool for_drop() const { return (run_flags_ & FOR_DROP) != 0; } | 59 bool for_drop() const { return (run_flags_ & FOR_DROP) != 0; } |
| 60 | 60 |
| 61 void AddObserver(WrenchMenuObserver* observer); | 61 void AddObserver(WrenchMenuObserver* observer); |
| 62 void RemoveObserver(WrenchMenuObserver* observer); | 62 void RemoveObserver(WrenchMenuObserver* observer); |
| 63 | 63 |
| 64 // MenuDelegate overrides: | 64 // MenuDelegate overrides: |
| 65 virtual const gfx::FontList* GetLabelFontList(int command_id) const OVERRIDE; | 65 virtual const gfx::FontList* GetLabelFontList(int command_id) const override; |
| 66 virtual bool GetShouldUseDisabledEmphasizedForegroundColor( | 66 virtual bool GetShouldUseDisabledEmphasizedForegroundColor( |
| 67 int command_id) const OVERRIDE; | 67 int command_id) const override; |
| 68 virtual base::string16 GetTooltipText(int command_id, | 68 virtual base::string16 GetTooltipText(int command_id, |
| 69 const gfx::Point& p) const OVERRIDE; | 69 const gfx::Point& p) const override; |
| 70 virtual bool IsTriggerableEvent(views::MenuItemView* menu, | 70 virtual bool IsTriggerableEvent(views::MenuItemView* menu, |
| 71 const ui::Event& e) OVERRIDE; | 71 const ui::Event& e) override; |
| 72 virtual bool GetDropFormats( | 72 virtual bool GetDropFormats( |
| 73 views::MenuItemView* menu, | 73 views::MenuItemView* menu, |
| 74 int* formats, | 74 int* formats, |
| 75 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; | 75 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) override; |
| 76 virtual bool AreDropTypesRequired(views::MenuItemView* menu) OVERRIDE; | 76 virtual bool AreDropTypesRequired(views::MenuItemView* menu) override; |
| 77 virtual bool CanDrop(views::MenuItemView* menu, | 77 virtual bool CanDrop(views::MenuItemView* menu, |
| 78 const ui::OSExchangeData& data) OVERRIDE; | 78 const ui::OSExchangeData& data) override; |
| 79 virtual int GetDropOperation(views::MenuItemView* item, | 79 virtual int GetDropOperation(views::MenuItemView* item, |
| 80 const ui::DropTargetEvent& event, | 80 const ui::DropTargetEvent& event, |
| 81 DropPosition* position) OVERRIDE; | 81 DropPosition* position) override; |
| 82 virtual int OnPerformDrop(views::MenuItemView* menu, | 82 virtual int OnPerformDrop(views::MenuItemView* menu, |
| 83 DropPosition position, | 83 DropPosition position, |
| 84 const ui::DropTargetEvent& event) OVERRIDE; | 84 const ui::DropTargetEvent& event) override; |
| 85 virtual bool ShowContextMenu(views::MenuItemView* source, | 85 virtual bool ShowContextMenu(views::MenuItemView* source, |
| 86 int command_id, | 86 int command_id, |
| 87 const gfx::Point& p, | 87 const gfx::Point& p, |
| 88 ui::MenuSourceType source_type) OVERRIDE; | 88 ui::MenuSourceType source_type) override; |
| 89 virtual bool CanDrag(views::MenuItemView* menu) OVERRIDE; | 89 virtual bool CanDrag(views::MenuItemView* menu) override; |
| 90 virtual void WriteDragData(views::MenuItemView* sender, | 90 virtual void WriteDragData(views::MenuItemView* sender, |
| 91 ui::OSExchangeData* data) OVERRIDE; | 91 ui::OSExchangeData* data) override; |
| 92 virtual int GetDragOperations(views::MenuItemView* sender) OVERRIDE; | 92 virtual int GetDragOperations(views::MenuItemView* sender) override; |
| 93 virtual int GetMaxWidthForMenu(views::MenuItemView* menu) OVERRIDE; | 93 virtual int GetMaxWidthForMenu(views::MenuItemView* menu) override; |
| 94 virtual bool IsItemChecked(int command_id) const OVERRIDE; | 94 virtual bool IsItemChecked(int command_id) const override; |
| 95 virtual bool IsCommandEnabled(int command_id) const OVERRIDE; | 95 virtual bool IsCommandEnabled(int command_id) const override; |
| 96 virtual void ExecuteCommand(int command_id, int mouse_event_flags) OVERRIDE; | 96 virtual void ExecuteCommand(int command_id, int mouse_event_flags) override; |
| 97 virtual bool GetAccelerator(int command_id, | 97 virtual bool GetAccelerator(int command_id, |
| 98 ui::Accelerator* accelerator) const OVERRIDE; | 98 ui::Accelerator* accelerator) const override; |
| 99 virtual void WillShowMenu(views::MenuItemView* menu) OVERRIDE; | 99 virtual void WillShowMenu(views::MenuItemView* menu) override; |
| 100 virtual void WillHideMenu(views::MenuItemView* menu) OVERRIDE; | 100 virtual void WillHideMenu(views::MenuItemView* menu) override; |
| 101 virtual bool ShouldCloseOnDragComplete() OVERRIDE; | 101 virtual bool ShouldCloseOnDragComplete() override; |
| 102 | 102 |
| 103 // BaseBookmarkModelObserver overrides: | 103 // BaseBookmarkModelObserver overrides: |
| 104 virtual void BookmarkModelChanged() OVERRIDE; | 104 virtual void BookmarkModelChanged() override; |
| 105 | 105 |
| 106 // content::NotificationObserver overrides: | 106 // content::NotificationObserver overrides: |
| 107 virtual void Observe(int type, | 107 virtual void Observe(int type, |
| 108 const content::NotificationSource& source, | 108 const content::NotificationSource& source, |
| 109 const content::NotificationDetails& details) OVERRIDE; | 109 const content::NotificationDetails& details) override; |
| 110 | 110 |
| 111 private: | 111 private: |
| 112 class CutCopyPasteView; | 112 class CutCopyPasteView; |
| 113 class RecentTabsMenuModelDelegate; | 113 class RecentTabsMenuModelDelegate; |
| 114 class ZoomView; | 114 class ZoomView; |
| 115 | 115 |
| 116 typedef std::pair<ui::MenuModel*,int> Entry; | 116 typedef std::pair<ui::MenuModel*,int> Entry; |
| 117 typedef std::map<int,Entry> CommandIDToEntry; | 117 typedef std::map<int,Entry> CommandIDToEntry; |
| 118 | 118 |
| 119 // Populates |parent| with all the child menus in |model|. Recursively invokes | 119 // Populates |parent| with all the child menus in |model|. Recursively invokes |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 // The bit mask of RunFlags. | 182 // The bit mask of RunFlags. |
| 183 const int run_flags_; | 183 const int run_flags_; |
| 184 | 184 |
| 185 ObserverList<WrenchMenuObserver> observer_list_; | 185 ObserverList<WrenchMenuObserver> observer_list_; |
| 186 | 186 |
| 187 DISALLOW_COPY_AND_ASSIGN(WrenchMenu); | 187 DISALLOW_COPY_AND_ASSIGN(WrenchMenu); |
| 188 }; | 188 }; |
| 189 | 189 |
| 190 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_MENU_H_ | 190 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_MENU_H_ |
| OLD | NEW |