| Index: chrome/browser/input_method/input_method_engine_base.h
|
| diff --git a/chrome/browser/chromeos/input_method/input_method_engine.h b/chrome/browser/input_method/input_method_engine_base.h
|
| similarity index 56%
|
| copy from chrome/browser/chromeos/input_method/input_method_engine.h
|
| copy to chrome/browser/input_method/input_method_engine_base.h
|
| index 9687222fca4e7fbcf1addd19feb2774c70e963ef..cfeab4e6d9217434b7794a8f262af62d90fb4639 100644
|
| --- a/chrome/browser/chromeos/input_method/input_method_engine.h
|
| +++ b/chrome/browser/input_method/input_method_engine_base.h
|
| @@ -1,12 +1,9 @@
|
| -// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Copyright 2016 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_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_
|
| -#define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_
|
| -
|
| -#include <stddef.h>
|
| -#include <stdint.h>
|
| +#ifndef CHROME_BROWSER_INPUT_METHOD_INPUT_METHOD_ENGINE_BASE_H_
|
| +#define CHROME_BROWSER_INPUT_METHOD_INPUT_METHOD_ENGINE_BASE_H_
|
|
|
| #include <map>
|
| #include <string>
|
| @@ -20,31 +17,38 @@
|
| class Profile;
|
|
|
| namespace ui {
|
| -class CandidateWindow;
|
| struct CompositionText;
|
| class IMEEngineHandlerInterface;
|
| class IMEEngineObserver;
|
| class KeyEvent;
|
| -
|
| -namespace ime {
|
| -struct InputMethodMenuItem;
|
| -} // namespace ime
|
| } // namespace ui
|
|
|
| -namespace chromeos {
|
| +namespace input_method {
|
|
|
| -class InputMethodEngine : public ui::IMEEngineHandlerInterface {
|
| +class InputMethodEngineBase : virtual public ui::IMEEngineHandlerInterface {
|
| public:
|
| - InputMethodEngine();
|
| + InputMethodEngineBase();
|
|
|
| - ~InputMethodEngine() override;
|
| + ~InputMethodEngineBase() override;
|
|
|
| void Initialize(scoped_ptr<ui::IMEEngineObserver> observer,
|
| const char* extension_id,
|
| Profile* profile);
|
|
|
| // IMEEngineHandlerInterface overrides.
|
| - const std::string& GetActiveComponentId() const override;
|
| + void FocusIn(const ui::IMEEngineHandlerInterface::InputContext& input_context)
|
| + override;
|
| + void FocusOut() override;
|
| + void Enable(const std::string& component_id) override;
|
| + void Disable() override;
|
| + void Reset() override;
|
| + void ProcessKeyEvent(const ui::KeyEvent& key_event,
|
| + KeyEventDoneCallback& callback) override;
|
| + void SetSurroundingText(const std::string& text,
|
| + uint32_t cursor_pos,
|
| + uint32_t anchor_pos,
|
| + uint32_t offset_pos) override;
|
| + void SetCompositionBounds(const std::vector<gfx::Rect>& bounds) override;
|
| bool SetComposition(int context_id,
|
| const char* text,
|
| int selection_start,
|
| @@ -56,57 +60,15 @@ class InputMethodEngine : public ui::IMEEngineHandlerInterface {
|
| bool CommitText(int context_id,
|
| const char* text,
|
| std::string* error) override;
|
| - bool SendKeyEvents(int context_id,
|
| - const std::vector<KeyboardEvent>& events) override;
|
| - const CandidateWindowProperty& GetCandidateWindowProperty() const override;
|
| - void SetCandidateWindowProperty(
|
| - const CandidateWindowProperty& property) override;
|
| - bool SetCandidateWindowVisible(bool visible, std::string* error) override;
|
| - bool SetCandidates(int context_id,
|
| - const std::vector<Candidate>& candidates,
|
| - std::string* error) override;
|
| - bool SetCursorPosition(int context_id,
|
| - int candidate_id,
|
| - std::string* error) override;
|
| - bool SetMenuItems(const std::vector<MenuItem>& items) override;
|
| - bool UpdateMenuItems(const std::vector<MenuItem>& items) override;
|
| - bool IsActive() const override;
|
| + const std::string& GetActiveComponentId() const override;
|
| bool DeleteSurroundingText(int context_id,
|
| int offset,
|
| size_t number_of_chars,
|
| std::string* error) override;
|
| -
|
| - // IMEEngineHandlerInterface overrides.
|
| - void FocusIn(const ui::IMEEngineHandlerInterface::InputContext& input_context)
|
| - override;
|
| - void FocusOut() override;
|
| - void Enable(const std::string& component_id) override;
|
| - void Disable() override;
|
| - void PropertyActivate(const std::string& property_name) override;
|
| - void Reset() override;
|
| - void ProcessKeyEvent(const ui::KeyEvent& key_event,
|
| - KeyEventDoneCallback& callback) override;
|
| - void CandidateClicked(uint32_t index) override;
|
| - void SetSurroundingText(const std::string& text,
|
| - uint32_t cursor_pos,
|
| - uint32_t anchor_pos,
|
| - uint32_t offset_pos) override;
|
| - void HideInputView() override;
|
| - void SetCompositionBounds(const std::vector<gfx::Rect>& bounds) override;
|
| -
|
| int GetCotextIdForTesting() { return context_id_; }
|
| -
|
| bool IsInterestedInKeyEvent() const override;
|
|
|
| - private:
|
| - bool CheckProfile() const;
|
| - // Converts MenuItem to InputMethodMenuItem.
|
| - void MenuItemToProperty(const MenuItem& item,
|
| - ui::ime::InputMethodMenuItem* property);
|
| -
|
| - // Enables overriding input view page to Virtual Keyboard window.
|
| - void EnableInputView();
|
| -
|
| + protected:
|
| ui::TextInputType current_input_type_;
|
|
|
| // ID that is used for the current input context. False if there is no focus.
|
| @@ -128,21 +90,6 @@ class InputMethodEngine : public ui::IMEEngineHandlerInterface {
|
| scoped_ptr<ui::CompositionText> composition_text_;
|
| int composition_cursor_;
|
|
|
| - // The current candidate window.
|
| - scoped_ptr<ui::CandidateWindow> candidate_window_;
|
| -
|
| - // The current candidate window property.
|
| - CandidateWindowProperty candidate_window_property_;
|
| -
|
| - // Indicates whether the candidate window is visible.
|
| - bool window_visible_;
|
| -
|
| - // Mapping of candidate index to candidate id.
|
| - std::vector<int> candidate_ids_;
|
| -
|
| - // Mapping of candidate id to index.
|
| - std::map<int, int> candidate_indexes_;
|
| -
|
| // Used with SendKeyEvents and ProcessKeyEvent to check if the key event
|
| // sent to ProcessKeyEvent is sent by SendKeyEvents.
|
| const ui::KeyEvent* sent_key_event_;
|
| @@ -150,6 +97,6 @@ class InputMethodEngine : public ui::IMEEngineHandlerInterface {
|
| Profile* profile_;
|
| };
|
|
|
| -} // namespace chromeos
|
| +} // namespace input_method
|
|
|
| -#endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_
|
| +#endif // CHROME_BROWSER_INPUT_METHOD_INPUT_METHOD_ENGINE_BASE_H_
|
|
|