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_TOOLBAR_APP_MENU_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_APP_MENU_MODEL_H_ |
6 #define CHROME_BROWSER_UI_TOOLBAR_APP_MENU_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_APP_MENU_MODEL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 class EncodingMenuModel : public ui::SimpleMenuModel, | 79 class EncodingMenuModel : public ui::SimpleMenuModel, |
80 public ui::SimpleMenuModel::Delegate { | 80 public ui::SimpleMenuModel::Delegate { |
81 public: | 81 public: |
82 explicit EncodingMenuModel(Browser* browser); | 82 explicit EncodingMenuModel(Browser* browser); |
83 ~EncodingMenuModel() override; | 83 ~EncodingMenuModel() override; |
84 | 84 |
85 // Overridden from ui::SimpleMenuModel::Delegate: | 85 // Overridden from ui::SimpleMenuModel::Delegate: |
86 bool IsCommandIdChecked(int command_id) const override; | 86 bool IsCommandIdChecked(int command_id) const override; |
87 bool IsCommandIdEnabled(int command_id) const override; | 87 bool IsCommandIdEnabled(int command_id) const override; |
88 bool GetAcceleratorForCommandId(int command_id, | 88 bool GetAcceleratorForCommandId(int command_id, |
89 ui::Accelerator* accelerator) override; | 89 ui::Accelerator* accelerator) const override; |
90 void ExecuteCommand(int command_id, int event_flags) override; | 90 void ExecuteCommand(int command_id, int event_flags) override; |
91 | 91 |
92 private: | 92 private: |
93 void Build(); | 93 void Build(); |
94 | 94 |
95 Browser* browser_; // weak | 95 Browser* browser_; // weak |
96 | 96 |
97 DISALLOW_COPY_AND_ASSIGN(EncodingMenuModel); | 97 DISALLOW_COPY_AND_ASSIGN(EncodingMenuModel); |
98 }; | 98 }; |
99 | 99 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 // Overridden for both ButtonMenuItemModel::Delegate and SimpleMenuModel: | 142 // Overridden for both ButtonMenuItemModel::Delegate and SimpleMenuModel: |
143 bool IsItemForCommandIdDynamic(int command_id) const override; | 143 bool IsItemForCommandIdDynamic(int command_id) const override; |
144 base::string16 GetLabelForCommandId(int command_id) const override; | 144 base::string16 GetLabelForCommandId(int command_id) const override; |
145 bool GetIconForCommandId(int command_id, gfx::Image* icon) const override; | 145 bool GetIconForCommandId(int command_id, gfx::Image* icon) const override; |
146 void ExecuteCommand(int command_id, int event_flags) override; | 146 void ExecuteCommand(int command_id, int event_flags) override; |
147 bool IsCommandIdChecked(int command_id) const override; | 147 bool IsCommandIdChecked(int command_id) const override; |
148 bool IsCommandIdEnabled(int command_id) const override; | 148 bool IsCommandIdEnabled(int command_id) const override; |
149 bool IsCommandIdVisible(int command_id) const override; | 149 bool IsCommandIdVisible(int command_id) const override; |
150 bool GetAcceleratorForCommandId(int command_id, | 150 bool GetAcceleratorForCommandId(int command_id, |
151 ui::Accelerator* accelerator) override; | 151 ui::Accelerator* accelerator) const override; |
152 | 152 |
153 // Overridden from TabStripModelObserver: | 153 // Overridden from TabStripModelObserver: |
154 void ActiveTabChanged(content::WebContents* old_contents, | 154 void ActiveTabChanged(content::WebContents* old_contents, |
155 content::WebContents* new_contents, | 155 content::WebContents* new_contents, |
156 int index, | 156 int index, |
157 int reason) override; | 157 int reason) override; |
158 void TabReplacedAt(TabStripModel* tab_strip_model, | 158 void TabReplacedAt(TabStripModel* tab_strip_model, |
159 content::WebContents* old_contents, | 159 content::WebContents* old_contents, |
160 content::WebContents* new_contents, | 160 content::WebContents* new_contents, |
161 int index) override; | 161 int index) override; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 Browser* browser_; // weak | 247 Browser* browser_; // weak |
248 | 248 |
249 std::unique_ptr<content::HostZoomMap::Subscription> | 249 std::unique_ptr<content::HostZoomMap::Subscription> |
250 browser_zoom_subscription_; | 250 browser_zoom_subscription_; |
251 content::NotificationRegistrar registrar_; | 251 content::NotificationRegistrar registrar_; |
252 | 252 |
253 DISALLOW_COPY_AND_ASSIGN(AppMenuModel); | 253 DISALLOW_COPY_AND_ASSIGN(AppMenuModel); |
254 }; | 254 }; |
255 | 255 |
256 #endif // CHROME_BROWSER_UI_TOOLBAR_APP_MENU_MODEL_H_ | 256 #endif // CHROME_BROWSER_UI_TOOLBAR_APP_MENU_MODEL_H_ |
OLD | NEW |