OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_HTML_VIEWER_IME_CONTROLLER_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_IME_CONTROLLER_H_ |
6 #define COMPONENTS_HTML_VIEWER_IME_CONTROLLER_H_ | 6 #define COMPONENTS_HTML_VIEWER_IME_CONTROLLER_H_ |
7 | 7 |
8 #include "third_party/WebKit/public/web/WebTextInputInfo.h" | 8 #include "third_party/WebKit/public/web/WebTextInputInfo.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 class WebGestureEvent; | 11 class WebGestureEvent; |
12 class WebWidget; | 12 class WebWidget; |
13 } | 13 } |
14 | 14 |
15 namespace mojo { | 15 namespace mus { |
16 class View; | 16 class View; |
17 } | 17 } |
18 | 18 |
19 namespace html_viewer { | 19 namespace html_viewer { |
20 | 20 |
21 // This class is used by HTMLWidgetRootLocal and HTMLWidgetLocalRoot for | 21 // This class is used by HTMLWidgetRootLocal and HTMLWidgetLocalRoot for |
22 // handling IME related stuff. | 22 // handling IME related stuff. |
23 class ImeController { | 23 class ImeController { |
24 public: | 24 public: |
25 ImeController(mojo::View* view, blink::WebWidget* widget); | 25 ImeController(mus::View* view, blink::WebWidget* widget); |
26 ~ImeController(); | 26 ~ImeController(); |
27 | 27 |
28 // Methods called by WebWidget overrides. | 28 // Methods called by WebWidget overrides. |
29 void ResetInputMethod(); | 29 void ResetInputMethod(); |
30 void DidHandleGestureEvent(const blink::WebGestureEvent& event, | 30 void DidHandleGestureEvent(const blink::WebGestureEvent& event, |
31 bool event_cancelled); | 31 bool event_cancelled); |
32 void DidUpdateTextOfFocusedElementByNonUserInput(); | 32 void DidUpdateTextOfFocusedElementByNonUserInput(); |
33 void ShowImeIfNeeded(); | 33 void ShowImeIfNeeded(); |
34 | 34 |
35 private: | 35 private: |
36 // Update text input state from WebWidget to mojo::View. If the focused | 36 // Update text input state from WebWidget to mus::View. If the focused |
37 // element is editable and |show_ime| is True, the software keyboard will be | 37 // element is editable and |show_ime| is True, the software keyboard will be |
38 // shown. | 38 // shown. |
39 void UpdateTextInputState(bool show_ime); | 39 void UpdateTextInputState(bool show_ime); |
40 | 40 |
41 // Not owned objects. | 41 // Not owned objects. |
42 mojo::View* view_; | 42 mus::View* view_; |
43 blink::WebWidget* widget_; | 43 blink::WebWidget* widget_; |
44 | 44 |
45 blink::WebTextInputInfo text_input_info_; | 45 blink::WebTextInputInfo text_input_info_; |
46 | 46 |
47 DISALLOW_COPY_AND_ASSIGN(ImeController); | 47 DISALLOW_COPY_AND_ASSIGN(ImeController); |
48 }; | 48 }; |
49 | 49 |
50 } // namespace html_viewer | 50 } // namespace html_viewer |
51 | 51 |
52 #endif // COMPONENTS_HTML_VIEWER_IME_CONTROLLER_H_ | 52 #endif // COMPONENTS_HTML_VIEWER_IME_CONTROLLER_H_ |
OLD | NEW |