OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "content/shell/renderer/test_runner/text_input_controller.h" | 5 #include "content/shell/renderer/test_runner/text_input_controller.h" |
6 | 6 |
7 #include "gin/arguments.h" | 7 #include "gin/arguments.h" |
8 #include "gin/handle.h" | 8 #include "gin/handle.h" |
9 #include "gin/object_template_builder.h" | 9 #include "gin/object_template_builder.h" |
10 #include "gin/wrappable.h" | 10 #include "gin/wrappable.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 : public gin::Wrappable<TextInputControllerBindings> { | 22 : public gin::Wrappable<TextInputControllerBindings> { |
23 public: | 23 public: |
24 static gin::WrapperInfo kWrapperInfo; | 24 static gin::WrapperInfo kWrapperInfo; |
25 | 25 |
26 static void Install(base::WeakPtr<TextInputController> controller, | 26 static void Install(base::WeakPtr<TextInputController> controller, |
27 blink::WebFrame* frame); | 27 blink::WebFrame* frame); |
28 | 28 |
29 private: | 29 private: |
30 explicit TextInputControllerBindings( | 30 explicit TextInputControllerBindings( |
31 base::WeakPtr<TextInputController> controller); | 31 base::WeakPtr<TextInputController> controller); |
32 virtual ~TextInputControllerBindings(); | 32 ~TextInputControllerBindings() override; |
33 | 33 |
34 // gin::Wrappable: | 34 // gin::Wrappable: |
35 virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder( | 35 gin::ObjectTemplateBuilder GetObjectTemplateBuilder( |
36 v8::Isolate* isolate) override; | 36 v8::Isolate* isolate) override; |
37 | 37 |
38 void InsertText(const std::string& text); | 38 void InsertText(const std::string& text); |
39 void UnmarkText(); | 39 void UnmarkText(); |
40 void DoCommand(const std::string& text); | 40 void DoCommand(const std::string& text); |
41 void SetMarkedText(const std::string& text, int start, int length); | 41 void SetMarkedText(const std::string& text, int start, int length); |
42 bool HasMarkedText(); | 42 bool HasMarkedText(); |
43 std::vector<int> MarkedRange(); | 43 std::vector<int> MarkedRange(); |
44 std::vector<int> SelectedRange(); | 44 std::vector<int> SelectedRange(); |
45 std::vector<int> FirstRectForCharacterRange(unsigned location, | 45 std::vector<int> FirstRectForCharacterRange(unsigned location, |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 key_down.windowsKeyCode = 0xE5; // VKEY_PROCESSKEY | 255 key_down.windowsKeyCode = 0xE5; // VKEY_PROCESSKEY |
256 key_down.setKeyIdentifierFromWindowsKeyCode(); | 256 key_down.setKeyIdentifierFromWindowsKeyCode(); |
257 view_->handleInputEvent(key_down); | 257 view_->handleInputEvent(key_down); |
258 | 258 |
259 blink::WebVector<blink::WebCompositionUnderline> underlines; | 259 blink::WebVector<blink::WebCompositionUnderline> underlines; |
260 blink::WebString web_text(blink::WebString::fromUTF8(text)); | 260 blink::WebString web_text(blink::WebString::fromUTF8(text)); |
261 view_->setComposition(web_text, underlines, 0, web_text.length()); | 261 view_->setComposition(web_text, underlines, 0, web_text.length()); |
262 } | 262 } |
263 | 263 |
264 } // namespace content | 264 } // namespace content |
OLD | NEW |