| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_TRANSLATE_LANGUAGES_MENU_MODEL_H_ | |
| 6 #define CHROME_BROWSER_TRANSLATE_LANGUAGES_MENU_MODEL_H_ | |
| 7 | |
| 8 #include "ui/base/models/simple_menu_model.h" | |
| 9 | |
| 10 class TranslateInfoBarDelegate; | |
| 11 | |
| 12 // A menu model that builds the contents of the language menus in the translate | |
| 13 // infobar. This menu has only one level (no submenus). | |
| 14 class LanguagesMenuModel : public ui::SimpleMenuModel, | |
| 15 public ui::SimpleMenuModel::Delegate { | |
| 16 public: | |
| 17 enum LanguageType { | |
| 18 ORIGINAL, | |
| 19 TARGET | |
| 20 }; | |
| 21 LanguagesMenuModel(TranslateInfoBarDelegate* translate_delegate, | |
| 22 LanguageType language_type); | |
| 23 virtual ~LanguagesMenuModel(); | |
| 24 | |
| 25 // ui::SimpleMenuModel::Delegate implementation: | |
| 26 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | |
| 27 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | |
| 28 virtual bool GetAcceleratorForCommandId( | |
| 29 int command_id, | |
| 30 ui::Accelerator* accelerator) OVERRIDE; | |
| 31 virtual void ExecuteCommand(int command_id) OVERRIDE; | |
| 32 | |
| 33 private: | |
| 34 TranslateInfoBarDelegate* translate_infobar_delegate_; | |
| 35 LanguageType language_type_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(LanguagesMenuModel); | |
| 38 }; | |
| 39 | |
| 40 #endif // CHROME_BROWSER_TRANSLATE_LANGUAGES_MENU_MODEL_H_ | |
| OLD | NEW |