Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: chrome/browser/ui/views/infobars/translate_language_menu_model.h

Issue 325483003: Remove unused Views Translate InfoBar code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove test-only infobar toggle; no-op tests for incompatible UX. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_UI_VIEWS_INFOBARS_TRANSLATE_LANGUAGE_MENU_MODEL_H_
6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_TRANSLATE_LANGUAGE_MENU_MODEL_H_
7
8 #include "ui/base/models/simple_menu_model.h"
9
10 class TranslateInfoBarBase;
11 class TranslateInfoBarDelegate;
12
13 namespace views {
14 class MenuButton;
15 }
16
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 {
21 public:
22 enum LanguageType {
23 ORIGINAL,
24 TARGET
25 };
26
27 TranslateLanguageMenuModel(LanguageType language_type,
28 TranslateInfoBarDelegate* infobar_delegate,
29 TranslateInfoBarBase* infobar,
30 views::MenuButton* button,
31 bool translate_on_change);
32 virtual ~TranslateLanguageMenuModel();
33
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(
38 int command_id,
39 ui::Accelerator* accelerator) OVERRIDE;
40 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
41
42 private:
43 size_t GetLanguageIndex() const;
44
45 LanguageType language_type_;
46 TranslateInfoBarDelegate* infobar_delegate_;
47 TranslateInfoBarBase* infobar_;
48 views::MenuButton* button_;
49 const bool translate_on_change_;
50
51 DISALLOW_COPY_AND_ASSIGN(TranslateLanguageMenuModel);
52 };
53
54 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_TRANSLATE_LANGUAGE_MENU_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698