Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLCHECKER_SUBMENU_OBSERVER_H_ | |
| 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLCHECKER_SUBMENU_OBSERVER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/compiler_specific.h" | |
| 12 #include "components/renderer_context_menu/render_view_context_menu_observer.h" | |
| 13 #include "ui/base/models/simple_menu_model.h" | |
| 14 | |
| 15 class RenderViewContextMenuProxy; | |
| 16 | |
| 17 // A class that implements the 'spell-checker options' submenu. This class | |
|
lazyboy
2016/01/28 20:36:25
I would call it so: SpellcheckerOptionsSubMenuObse
please use gerrit instead
2016/01/28 21:42:00
Done.
| |
| 18 // creates the submenu, adds it to the parent menu, and handles events. | |
| 19 class SpellCheckerSubMenuObserver : public RenderViewContextMenuObserver { | |
| 20 public: | |
| 21 SpellCheckerSubMenuObserver(RenderViewContextMenuProxy* proxy, | |
| 22 ui::SimpleMenuModel::Delegate* delegate, | |
| 23 int group); | |
|
lazyboy
2016/01/28 20:36:25
group_id
please use gerrit instead
2016/01/28 21:42:00
Done.
| |
| 24 ~SpellCheckerSubMenuObserver() override; | |
| 25 | |
| 26 // RenderViewContextMenuObserver implementation. | |
| 27 void InitMenu(const content::ContextMenuParams& params) override; | |
| 28 bool IsCommandIdSupported(int command_id) override; | |
| 29 bool IsCommandIdChecked(int command_id) override; | |
| 30 bool IsCommandIdEnabled(int command_id) override; | |
| 31 void ExecuteCommand(int command_id) override; | |
| 32 | |
| 33 private: | |
| 34 // The interface for adding a submenu to the parent. | |
| 35 RenderViewContextMenuProxy* proxy_; | |
| 36 | |
| 37 // The submenu of the 'spell-checker options'. This class adds items to this | |
| 38 // submenu and add it to the parent menu. | |
|
lazyboy
2016/01/28 20:36:25
nit: adds
please use gerrit instead
2016/01/28 21:42:00
Done.
| |
| 39 ui::SimpleMenuModel submenu_model_; | |
| 40 | |
| 41 // The radio items representing languages available for spellchecking. | |
|
lazyboy
2016/01/28 20:36:25
The id of radio items...
please use gerrit instead
2016/01/28 21:42:00
Done.
| |
| 42 int language_group_; | |
|
lazyboy
2016/01/28 20:36:25
language_group_id_
please use gerrit instead
2016/01/28 21:42:00
Done.
| |
| 43 | |
| 44 // The number of languages currently selected for spellchecking, which are | |
| 45 // also the first elements in |languages_|. | |
| 46 size_t num_selected_languages_; | |
| 47 | |
| 48 // A vector of all languages available for spellchecking. | |
| 49 std::vector<std::string> languages_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(SpellCheckerSubMenuObserver); | |
| 52 }; | |
| 53 | |
| 54 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLCHECKER_SUBMENU_OBSERVER_H_ | |
| OLD | NEW |