ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chrome / browser / renderer_context_menu / spellchecker_submenu_observer.h
blob23b7e8666943065f5566a62c8fa1492d12cfc283
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 CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLCHECKER_SUBMENU_OBSERVER_H_
6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLCHECKER_SUBMENU_OBSERVER_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "components/renderer_context_menu/render_view_context_menu_observer.h"
14 #include "ui/base/models/simple_menu_model.h"
16 class RenderViewContextMenuProxy;
18 // A class that implements the 'spell-checker options' submenu. This class
19 // creates the submenu, add it to the parent menu, and handles events.
20 class SpellCheckerSubMenuObserver : public RenderViewContextMenuObserver {
21 public:
22 SpellCheckerSubMenuObserver(RenderViewContextMenuProxy* proxy,
23 ui::SimpleMenuModel::Delegate* delegate,
24 int group);
25 ~SpellCheckerSubMenuObserver() override;
27 // RenderViewContextMenuObserver implementation.
28 void InitMenu(const content::ContextMenuParams& params) override;
29 bool IsCommandIdSupported(int command_id) override;
30 bool IsCommandIdChecked(int command_id) override;
31 bool IsCommandIdEnabled(int command_id) override;
32 void ExecuteCommand(int command_id) override;
34 private:
35 // The interface for adding a submenu to the parent.
36 RenderViewContextMenuProxy* proxy_;
38 // The submenu of the 'spell-checker options'. This class adds items to this
39 // submenu and add it to the parent menu.
40 ui::SimpleMenuModel submenu_model_;
42 #if !defined(OS_MACOSX)
43 // Hunspell spelling submenu.
44 // The radio items representing languages available for spellchecking.
45 int language_group_;
46 int language_selected_;
47 std::vector<std::string> languages_;
48 #endif // !OS_MACOSX
50 DISALLOW_COPY_AND_ASSIGN(SpellCheckerSubMenuObserver);
53 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLCHECKER_SUBMENU_OBSERVER_H_