| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_SPELLCHECKER_SUBMENU_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_SPELLCHECKER_SUBMENU_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_SPELLCHECKER_SUBMENU_OBSERVER_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_SPELLCHECKER_SUBMENU_OBSERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "chrome/browser/tab_contents/render_view_context_menu_observer.h" | 15 #include "chrome/browser/tab_contents/render_view_context_menu_observer.h" |
| 16 #include "ui/base/models/simple_menu_model.h" | 16 #include "ui/base/models/simple_menu_model.h" |
| 17 | 17 |
| 18 class RenderViewContextMenuProxy; | 18 class RenderViewContextMenuProxy; |
| 19 | 19 |
| 20 // A class that implements the 'spell-checker options' submenu. This class | 20 // A class that implements the 'spell-checker options' submenu. This class |
| 21 // creates the submenu, add it to the parent menu, and handles events. | 21 // creates the submenu, add it to the parent menu, and handles events. |
| 22 class SpellCheckerSubMenuObserver : public RenderViewContextMenuObserver { | 22 class SpellCheckerSubMenuObserver : public RenderViewContextMenuObserver { |
| 23 public: | 23 public: |
| 24 SpellCheckerSubMenuObserver(RenderViewContextMenuProxy* proxy, | 24 SpellCheckerSubMenuObserver(RenderViewContextMenuProxy* proxy, |
| 25 ui::SimpleMenuModel::Delegate* delegate, | 25 ui::SimpleMenuModel::Delegate* delegate, |
| 26 int group); | 26 int group); |
| 27 virtual ~SpellCheckerSubMenuObserver(); | 27 virtual ~SpellCheckerSubMenuObserver(); |
| 28 | 28 |
| 29 // RenderViewContextMenuObserver implementation. | 29 // RenderViewContextMenuObserver implementation. |
| 30 virtual void InitMenu(const ContextMenuParams& params) OVERRIDE; | 30 virtual void InitMenu(const content::ContextMenuParams& params) OVERRIDE; |
| 31 virtual bool IsCommandIdSupported(int command_id) OVERRIDE; | 31 virtual bool IsCommandIdSupported(int command_id) OVERRIDE; |
| 32 virtual bool IsCommandIdChecked(int command_id) OVERRIDE; | 32 virtual bool IsCommandIdChecked(int command_id) OVERRIDE; |
| 33 virtual bool IsCommandIdEnabled(int command_id) OVERRIDE; | 33 virtual bool IsCommandIdEnabled(int command_id) OVERRIDE; |
| 34 virtual void ExecuteCommand(int command_id) OVERRIDE; | 34 virtual void ExecuteCommand(int command_id) OVERRIDE; |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 // The interface for adding a submenu to the parent. | 37 // The interface for adding a submenu to the parent. |
| 38 RenderViewContextMenuProxy* proxy_; | 38 RenderViewContextMenuProxy* proxy_; |
| 39 | 39 |
| 40 // The submenu of the 'spell-checker options'. This class adds items to this | 40 // The submenu of the 'spell-checker options'. This class adds items to this |
| (...skipping 13 matching lines...) Expand all Loading... |
| 54 // The radio items representing languages available for spellchecking. | 54 // The radio items representing languages available for spellchecking. |
| 55 int language_group_; | 55 int language_group_; |
| 56 int language_selected_; | 56 int language_selected_; |
| 57 std::vector<std::string> languages_; | 57 std::vector<std::string> languages_; |
| 58 #endif // !OS_MACOSX | 58 #endif // !OS_MACOSX |
| 59 | 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(SpellCheckerSubMenuObserver); | 60 DISALLOW_COPY_AND_ASSIGN(SpellCheckerSubMenuObserver); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 #endif // CHROME_BROWSER_TAB_CONTENTS_SPELLCHECKER_SUBMENU_OBSERVER_H_ | 63 #endif // CHROME_BROWSER_TAB_CONTENTS_SPELLCHECKER_SUBMENU_OBSERVER_H_ |
| OLD | NEW |