OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_TRANSLATE_LANGUAGES_MENU_MODEL2_H_ |
| 6 #define CHROME_BROWSER_TRANSLATE_LANGUAGES_MENU_MODEL2_H_ |
| 7 |
| 8 #include "app/menus/simple_menu_model.h" |
| 9 |
| 10 class TranslateInfoBarDelegate2; |
| 11 class String16; |
| 12 |
| 13 // A menu model that builds the contents of the language menus in the translate |
| 14 // infobar. This menu has only one level (no submenus). |
| 15 class LanguagesMenuModel2 : public menus::SimpleMenuModel, |
| 16 public menus::SimpleMenuModel::Delegate { |
| 17 public: |
| 18 enum LanguageType { |
| 19 ORIGINAL, |
| 20 TARGET |
| 21 }; |
| 22 LanguagesMenuModel2(TranslateInfoBarDelegate2* translate_delegate, |
| 23 LanguageType language_type); |
| 24 virtual ~LanguagesMenuModel2(); |
| 25 |
| 26 // menus::SimpleMenuModel::Delegate implementation: |
| 27 virtual bool IsCommandIdChecked(int command_id) const; |
| 28 virtual bool IsCommandIdEnabled(int command_id) const; |
| 29 virtual bool GetAcceleratorForCommandId(int command_id, |
| 30 menus::Accelerator* accelerator); |
| 31 virtual void ExecuteCommand(int command_id); |
| 32 |
| 33 private: |
| 34 TranslateInfoBarDelegate2* translate_infobar_delegate_; |
| 35 LanguageType language_type_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(LanguagesMenuModel2); |
| 38 }; |
| 39 |
| 40 #endif // CHROME_BROWSER_TRANSLATE_LANGUAGES_MENU_MODEL2_H_ |
OLD | NEW |