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_FRAME_SYSTEM_MENU_MODEL_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_SYSTEM_MENU_MODEL_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_SYSTEM_MENU_MODEL_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_SYSTEM_MENU_MODEL_DELEGATE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "ui/base/accelerators/accelerator.h" | 10 #include "ui/base/accelerators/accelerator.h" |
11 #include "ui/base/models/simple_menu_model.h" | 11 #include "ui/base/models/simple_menu_model.h" |
12 | 12 |
13 // Provides the SimpleMenuModel::Delegate implementation for system context | 13 // Provides the SimpleMenuModel::Delegate implementation for system context |
14 // menus. | 14 // menus. |
15 class SystemMenuModelDelegate : public ui::SimpleMenuModel::Delegate { | 15 class SystemMenuModelDelegate : public ui::SimpleMenuModel::Delegate { |
16 public: | 16 public: |
17 SystemMenuModelDelegate(ui::AcceleratorProvider* provider, Browser* browser); | 17 SystemMenuModelDelegate(ui::AcceleratorProvider* provider, Browser* browser); |
18 virtual ~SystemMenuModelDelegate(); | 18 virtual ~SystemMenuModelDelegate(); |
19 | 19 |
20 Browser* browser() { return browser_; } | 20 Browser* browser() { return browser_; } |
21 | 21 |
22 // Overridden from ui::SimpleMenuModel::Delegate: | 22 // Overridden from ui::SimpleMenuModel::Delegate: |
23 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 23 virtual bool IsCommandIdChecked(int command_id) const override; |
24 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 24 virtual bool IsCommandIdEnabled(int command_id) const override; |
25 virtual bool GetAcceleratorForCommandId( | 25 virtual bool GetAcceleratorForCommandId( |
26 int command_id, | 26 int command_id, |
27 ui::Accelerator* accelerator) OVERRIDE; | 27 ui::Accelerator* accelerator) override; |
28 virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE; | 28 virtual bool IsItemForCommandIdDynamic(int command_id) const override; |
29 virtual base::string16 GetLabelForCommandId(int command_id) const OVERRIDE; | 29 virtual base::string16 GetLabelForCommandId(int command_id) const override; |
30 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 30 virtual void ExecuteCommand(int command_id, int event_flags) override; |
31 | 31 |
32 private: | 32 private: |
33 ui::AcceleratorProvider* provider_; // weak | 33 ui::AcceleratorProvider* provider_; // weak |
34 Browser* browser_; // weak | 34 Browser* browser_; // weak |
35 | 35 |
36 DISALLOW_COPY_AND_ASSIGN(SystemMenuModelDelegate); | 36 DISALLOW_COPY_AND_ASSIGN(SystemMenuModelDelegate); |
37 }; | 37 }; |
38 | 38 |
39 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_SYSTEM_MENU_MODEL_DELEGATE_H_ | 39 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_SYSTEM_MENU_MODEL_DELEGATE_H_ |
OLD | NEW |