OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TRANSLATE_OPTIONS_MENU_MODEL_H_ | 5 #ifndef CHROME_BROWSER_TRANSLATE_OPTIONS_MENU_MODEL_H_ |
6 #define CHROME_BROWSER_TRANSLATE_OPTIONS_MENU_MODEL_H_ | 6 #define CHROME_BROWSER_TRANSLATE_OPTIONS_MENU_MODEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/base/models/simple_menu_model.h" | 9 #include "ui/base/models/simple_menu_model.h" |
10 | 10 |
11 class TranslateInfoBarDelegate; | 11 class TranslateInfoBarDelegate; |
12 | 12 |
13 // A menu model that builds the contents of the options menu in the translate | 13 // A menu model that builds the contents of the options menu in the translate |
14 // infobar. This menu has only one level (no submenus). | 14 // infobar. This menu has only one level (no submenus). |
15 class OptionsMenuModel : public ui::SimpleMenuModel, | 15 class OptionsMenuModel : public ui::SimpleMenuModel, |
16 public ui::SimpleMenuModel::Delegate { | 16 public ui::SimpleMenuModel::Delegate { |
17 public: | 17 public: |
18 explicit OptionsMenuModel(TranslateInfoBarDelegate* translate_delegate); | 18 explicit OptionsMenuModel(TranslateInfoBarDelegate* translate_delegate); |
19 virtual ~OptionsMenuModel(); | 19 virtual ~OptionsMenuModel(); |
20 | 20 |
21 // ui::SimpleMenuModel::Delegate implementation: | 21 // ui::SimpleMenuModel::Delegate implementation: |
22 virtual bool IsCommandIdChecked(int command_id) const; | 22 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
23 virtual bool IsCommandIdEnabled(int command_id) const; | 23 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
24 virtual bool GetAcceleratorForCommandId(int command_id, | 24 virtual bool GetAcceleratorForCommandId( |
25 ui::Accelerator* accelerator); | 25 int command_id, |
26 virtual void ExecuteCommand(int command_id); | 26 ui::Accelerator* accelerator) OVERRIDE; |
| 27 virtual void ExecuteCommand(int command_id) OVERRIDE; |
27 | 28 |
28 private: | 29 private: |
29 TranslateInfoBarDelegate* translate_infobar_delegate_; | 30 TranslateInfoBarDelegate* translate_infobar_delegate_; |
30 | 31 |
31 DISALLOW_COPY_AND_ASSIGN(OptionsMenuModel); | 32 DISALLOW_COPY_AND_ASSIGN(OptionsMenuModel); |
32 }; | 33 }; |
33 | 34 |
34 #endif // CHROME_BROWSER_TRANSLATE_OPTIONS_MENU_MODEL_H_ | 35 #endif // CHROME_BROWSER_TRANSLATE_OPTIONS_MENU_MODEL_H_ |
OLD | NEW |