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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_TRANSLATE_LANGUAGE_MENU_MODEL_H_
6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_TRANSLATE_LANGUAGE_MENU_MODEL_H_
8 #include "ui/base/models/simple_menu_model.h"
10 class TranslateInfoBarBase
;
11 class TranslateInfoBarDelegate
;
17 // A menu model that builds the contents of the language menus in the translate
18 // infobar. This menu has only one level (no submenus).
19 class TranslateLanguageMenuModel
: public ui::SimpleMenuModel
,
20 public ui::SimpleMenuModel::Delegate
{
27 TranslateLanguageMenuModel(LanguageType language_type
,
28 TranslateInfoBarDelegate
* infobar_delegate
,
29 TranslateInfoBarBase
* infobar
,
30 views::MenuButton
* button
,
31 bool translate_on_change
);
32 virtual ~TranslateLanguageMenuModel();
34 // ui::SimpleMenuModel::Delegate implementation:
35 virtual bool IsCommandIdChecked(int command_id
) const OVERRIDE
;
36 virtual bool IsCommandIdEnabled(int command_id
) const OVERRIDE
;
37 virtual bool GetAcceleratorForCommandId(
39 ui::Accelerator
* accelerator
) OVERRIDE
;
40 virtual void ExecuteCommand(int command_id
, int event_flags
) OVERRIDE
;
43 size_t GetLanguageIndex() const;
45 LanguageType language_type_
;
46 TranslateInfoBarDelegate
* infobar_delegate_
;
47 TranslateInfoBarBase
* infobar_
;
48 views::MenuButton
* button_
;
49 const bool translate_on_change_
;
51 DISALLOW_COPY_AND_ASSIGN(TranslateLanguageMenuModel
);
54 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_TRANSLATE_LANGUAGE_MENU_MODEL_H_