Check USB device path access when prompting users to select a device.
[chromium-blink-merge.git] / chrome / browser / chromeos / input_method / mock_input_method_engine.h
blobe7228113b21205f97795caf66fcb334fa010ca7a
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_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_ENGINE_H_
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_ENGINE_H_
8 #include <string>
9 #include <vector>
11 #include "chrome/browser/chromeos/input_method/input_method_engine_interface.h"
12 #include "ui/base/ime/chromeos/input_method_descriptor.h"
14 namespace ui {
15 class KeyEvent;
17 namespace ime {
18 struct InputMethodMenuItem;
22 namespace chromeos {
24 class CompositionText;
26 namespace input_method {
27 class CandidateWindow;
28 struct KeyEventHandle;
31 class MockInputMethodEngine : public InputMethodEngineInterface {
32 public:
33 MockInputMethodEngine();
34 ~MockInputMethodEngine() override;
36 // InputMethodEngineInterface overrides.
37 const std::string& GetActiveComponentId() const override;
38 bool SetComposition(int context_id,
39 const char* text,
40 int selection_start,
41 int selection_end,
42 int cursor,
43 const std::vector<SegmentInfo>& segments,
44 std::string* error) override;
45 bool ClearComposition(int context_id, std::string* error) override;
46 bool CommitText(int context_id,
47 const char* text,
48 std::string* error) override;
49 bool SendKeyEvents(int context_id,
50 const std::vector<KeyboardEvent>& events) override;
51 const CandidateWindowProperty& GetCandidateWindowProperty() const override;
52 void SetCandidateWindowProperty(
53 const CandidateWindowProperty& property) override;
54 bool SetCandidateWindowVisible(bool visible, std::string* error) override;
55 bool SetCandidates(int context_id,
56 const std::vector<Candidate>& candidates,
57 std::string* error) override;
58 bool SetCursorPosition(int context_id,
59 int candidate_id,
60 std::string* error) override;
61 bool SetMenuItems(const std::vector<MenuItem>& items) override;
62 bool UpdateMenuItems(const std::vector<MenuItem>& items) override;
63 bool IsActive() const override;
64 bool DeleteSurroundingText(int context_id,
65 int offset,
66 size_t number_of_chars,
67 std::string* error) override;
69 // IMEEngineHandlerInterface overrides.
70 void FocusIn(
71 const IMEEngineHandlerInterface::InputContext& input_context) override;
72 void FocusOut() override;
73 void Enable(const std::string& component_id) override;
74 void Disable() override;
75 void PropertyActivate(const std::string& property_name) override;
76 void Reset() override;
77 void ProcessKeyEvent(const ui::KeyEvent& key_event,
78 const KeyEventDoneCallback& callback) override;
79 void CandidateClicked(uint32 index) override;
80 void SetSurroundingText(const std::string& text,
81 uint32 cursor_pos,
82 uint32 anchor_pos) override;
83 void SetCompositionBounds(const std::vector<gfx::Rect>& bounds) override;
84 void HideInputView() override;
86 std::string last_activated_property() const {
87 return last_activated_property_;
90 private:
91 std::string active_component_id_;
93 // The current candidate window property.
94 CandidateWindowProperty candidate_window_property_;
96 std::string last_activated_property_;
99 } // namespace chromeos
101 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_ENGINE_H_