Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / components / html_viewer / ime_controller.h
blob24923ab2bdd2154e94b3b306abf11c2402c78a5d
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_HTML_VIEWER_IME_CONTROLLER_H_
6 #define COMPONENTS_HTML_VIEWER_IME_CONTROLLER_H_
8 #include "third_party/WebKit/public/web/WebTextInputInfo.h"
10 namespace blink {
11 class WebGestureEvent;
12 class WebWidget;
15 namespace mus {
16 class View;
19 namespace html_viewer {
21 // This class is used by HTMLWidgetRootLocal and HTMLWidgetLocalRoot for
22 // handling IME related stuff.
23 class ImeController {
24 public:
25 ImeController(mus::View* view, blink::WebWidget* widget);
26 ~ImeController();
28 // Methods called by WebWidget overrides.
29 void ResetInputMethod();
30 void DidHandleGestureEvent(const blink::WebGestureEvent& event,
31 bool event_cancelled);
32 void DidUpdateTextOfFocusedElementByNonUserInput();
33 void ShowImeIfNeeded();
35 private:
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
38 // shown.
39 void UpdateTextInputState(bool show_ime);
41 // Not owned objects.
42 mus::View* view_;
43 blink::WebWidget* widget_;
45 blink::WebTextInputInfo text_input_info_;
47 DISALLOW_COPY_AND_ASSIGN(ImeController);
50 } // namespace html_viewer
52 #endif // COMPONENTS_HTML_VIEWER_IME_CONTROLLER_H_