Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / components / translate / core / browser / options_menu_model.h
blob5beae3bdd6ae4d09f0ac08a1a23f5e7d9df8a037
1 // Copyright 2014 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 COMPONENTS_TRANSLATE_CORE_BROWSER_OPTIONS_MENU_MODEL_H_
6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_OPTIONS_MENU_MODEL_H_
8 #include "ui/base/models/simple_menu_model.h"
10 namespace translate {
12 class TranslateInfoBarDelegate;
14 // A menu model that builds the contents of the options menu in the translate
15 // infobar. This menu has only one level (no submenus).
16 class OptionsMenuModel : public ui::SimpleMenuModel,
17 public ui::SimpleMenuModel::Delegate {
18 public:
19 // Command IDs of the items in this menu; exposed for testing.
20 enum CommandID {
21 ABOUT_TRANSLATE = 0,
22 ALWAYS_TRANSLATE,
23 NEVER_TRANSLATE_LANGUAGE,
24 NEVER_TRANSLATE_SITE,
25 REPORT_BAD_DETECTION
28 explicit OptionsMenuModel(TranslateInfoBarDelegate* translate_delegate);
29 ~OptionsMenuModel() override;
31 // ui::SimpleMenuModel::Delegate implementation:
32 bool IsCommandIdChecked(int command_id) const override;
33 bool IsCommandIdEnabled(int command_id) const override;
34 bool GetAcceleratorForCommandId(int command_id,
35 ui::Accelerator* accelerator) override;
36 void ExecuteCommand(int command_id, int event_flags) override;
38 private:
39 TranslateInfoBarDelegate* translate_infobar_delegate_;
41 DISALLOW_COPY_AND_ASSIGN(OptionsMenuModel);
44 } // namespace translate
46 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_OPTIONS_MENU_MODEL_H_