OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "web/WebInputMethodControllerImpl.h" | 5 #include "web/WebInputMethodControllerImpl.h" |
6 | 6 |
7 #include "core/InputTypeNames.h" | 7 #include "core/InputTypeNames.h" |
8 #include "core/dom/DocumentUserGestureToken.h" | 8 #include "core/dom/DocumentUserGestureToken.h" |
9 #include "core/editing/EditingUtilities.h" | 9 #include "core/editing/EditingUtilities.h" |
10 #include "core/editing/Editor.h" | 10 #include "core/editing/Editor.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 if (WebPlugin* plugin = focusedPluginIfInputMethodSupported()) | 123 if (WebPlugin* plugin = focusedPluginIfInputMethodSupported()) |
124 return plugin->commitText(text, relativeCaretPosition); | 124 return plugin->commitText(text, relativeCaretPosition); |
125 | 125 |
126 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets | 126 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
127 // needs to be audited. See http://crbug.com/590369 for more details. | 127 // needs to be audited. See http://crbug.com/590369 for more details. |
128 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); | 128 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
129 | 129 |
130 return inputMethodController().commitText(text, relativeCaretPosition); | 130 return inputMethodController().commitText(text, relativeCaretPosition); |
131 } | 131 } |
132 | 132 |
133 WebTextInputInfo WebInputMethodControllerImpl::textInputInfo() { | |
134 return frame()->inputMethodController().textInputInfo(); | |
135 } | |
136 | |
137 WebTextInputType WebInputMethodControllerImpl::textInputType() { | |
138 return frame()->inputMethodController().textInputType(); | |
139 } | |
140 | |
141 LocalFrame* WebInputMethodControllerImpl::frame() const { | 133 LocalFrame* WebInputMethodControllerImpl::frame() const { |
142 return m_webLocalFrame->frame(); | 134 return m_webLocalFrame->frame(); |
143 } | 135 } |
144 | 136 |
145 InputMethodController& WebInputMethodControllerImpl::inputMethodController() | 137 InputMethodController& WebInputMethodControllerImpl::inputMethodController() |
146 const { | 138 const { |
147 return frame()->inputMethodController(); | 139 return frame()->inputMethodController(); |
148 } | 140 } |
149 | 141 |
150 WebPlugin* WebInputMethodControllerImpl::focusedPluginIfInputMethodSupported() | 142 WebPlugin* WebInputMethodControllerImpl::focusedPluginIfInputMethodSupported() |
151 const { | 143 const { |
152 WebPluginContainerImpl* container = | 144 WebPluginContainerImpl* container = |
153 WebLocalFrameImpl::currentPluginContainer(frame()); | 145 WebLocalFrameImpl::currentPluginContainer(frame()); |
154 if (container && container->supportsInputMethod()) | 146 if (container && container->supportsInputMethod()) |
155 return container->plugin(); | 147 return container->plugin(); |
156 return nullptr; | 148 return nullptr; |
157 } | 149 } |
158 | 150 |
159 } // namespace blink | 151 } // namespace blink |
OLD | NEW |