Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 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 COMPONENTS_TRANSLATE_CORE_BROWSER_OPTIONS_MENU_MODEL_H_ |
| 6 #define CHROME_BROWSER_TRANSLATE_OPTIONS_MENU_MODEL_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_OPTIONS_MENU_MODEL_H_ |
| 7 | 7 |
| 8 #include "ui/base/models/simple_menu_model.h" | 8 #include "ui/base/models/simple_menu_model.h" |
| 9 | 9 |
| 10 class TranslateInfoBarDelegate; | 10 class TranslateInfoBarDelegate; |
| 11 | 11 |
| 12 // A menu model that builds the contents of the options menu in the translate | 12 // A menu model that builds the contents of the options menu in the translate |
| 13 // infobar. This menu has only one level (no submenus). | 13 // infobar. This menu has only one level (no submenus). |
| 14 class OptionsMenuModel : public ui::SimpleMenuModel, | 14 class OptionsMenuModel : public ui::SimpleMenuModel, |
| 15 public ui::SimpleMenuModel::Delegate { | 15 public ui::SimpleMenuModel::Delegate { |
| 16 public: | 16 public: |
| 17 explicit OptionsMenuModel(TranslateInfoBarDelegate* translate_delegate); | 17 explicit OptionsMenuModel(TranslateInfoBarDelegate* translate_delegate); |
| 18 virtual ~OptionsMenuModel(); | 18 virtual ~OptionsMenuModel(); |
| 19 | 19 |
| 20 // ui::SimpleMenuModel::Delegate implementation: | 20 // ui::SimpleMenuModel::Delegate implementation: |
| 21 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 21 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
| 22 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 22 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
| 23 virtual bool GetAcceleratorForCommandId( | 23 virtual bool GetAcceleratorForCommandId( |
| 24 int command_id, | 24 int command_id, |
| 25 ui::Accelerator* accelerator) OVERRIDE; | 25 ui::Accelerator* accelerator) OVERRIDE; |
| 26 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 26 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; |
| 27 | 27 |
| 28 // Command IDs of the items in this menu; exposed for testing. | |
| 29 static const int kOptionsAboutTranslate; | |
|
Peter Kasting
2014/05/21 20:38:24
Nit: Style guide says static consts go above all f
| |
| 30 static const int kOptionsAlwaysTranslate; | |
| 31 static const int kOptionsNeverTranslateLanguage; | |
| 32 static const int kOptionsNeverTranslateSite; | |
| 33 static const int kOptionsReportBadDetection; | |
| 34 | |
| 28 private: | 35 private: |
| 29 TranslateInfoBarDelegate* translate_infobar_delegate_; | 36 TranslateInfoBarDelegate* translate_infobar_delegate_; |
| 30 | 37 |
| 31 DISALLOW_COPY_AND_ASSIGN(OptionsMenuModel); | 38 DISALLOW_COPY_AND_ASSIGN(OptionsMenuModel); |
| 32 }; | 39 }; |
| 33 | 40 |
| 34 #endif // CHROME_BROWSER_TRANSLATE_OPTIONS_MENU_MODEL_H_ | 41 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_OPTIONS_MENU_MODEL_H_ |
| OLD | NEW |