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

Unified Diff: chrome/browser/renderer_context_menu/spellchecker_submenu_observer.h

Issue 1647723002: [win/cros/lin] Add back the spellcheck menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_context_menu/spellchecker_submenu_observer.h
diff --git a/chrome/browser/renderer_context_menu/spellchecker_submenu_observer.h b/chrome/browser/renderer_context_menu/spellchecker_submenu_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..be0fddd5caeec534f496c8f30659b026b08068a9
--- /dev/null
+++ b/chrome/browser/renderer_context_menu/spellchecker_submenu_observer.h
@@ -0,0 +1,54 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLCHECKER_SUBMENU_OBSERVER_H_
+#define CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLCHECKER_SUBMENU_OBSERVER_H_
+
+#include <string>
+#include <vector>
+
+#include "base/compiler_specific.h"
+#include "components/renderer_context_menu/render_view_context_menu_observer.h"
+#include "ui/base/models/simple_menu_model.h"
+
+class RenderViewContextMenuProxy;
+
+// 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.
+// creates the submenu, adds it to the parent menu, and handles events.
+class SpellCheckerSubMenuObserver : public RenderViewContextMenuObserver {
+ public:
+ SpellCheckerSubMenuObserver(RenderViewContextMenuProxy* proxy,
+ ui::SimpleMenuModel::Delegate* delegate,
+ int group);
lazyboy 2016/01/28 20:36:25 group_id
please use gerrit instead 2016/01/28 21:42:00 Done.
+ ~SpellCheckerSubMenuObserver() override;
+
+ // RenderViewContextMenuObserver implementation.
+ void InitMenu(const content::ContextMenuParams& params) override;
+ bool IsCommandIdSupported(int command_id) override;
+ bool IsCommandIdChecked(int command_id) override;
+ bool IsCommandIdEnabled(int command_id) override;
+ void ExecuteCommand(int command_id) override;
+
+ private:
+ // The interface for adding a submenu to the parent.
+ RenderViewContextMenuProxy* proxy_;
+
+ // The submenu of the 'spell-checker options'. This class adds items to this
+ // 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.
+ ui::SimpleMenuModel submenu_model_;
+
+ // 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.
+ int language_group_;
lazyboy 2016/01/28 20:36:25 language_group_id_
please use gerrit instead 2016/01/28 21:42:00 Done.
+
+ // The number of languages currently selected for spellchecking, which are
+ // also the first elements in |languages_|.
+ size_t num_selected_languages_;
+
+ // A vector of all languages available for spellchecking.
+ std::vector<std::string> languages_;
+
+ DISALLOW_COPY_AND_ASSIGN(SpellCheckerSubMenuObserver);
+};
+
+#endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLCHECKER_SUBMENU_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698