Chromium Code Reviews| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 | 127 |
| 128 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets | 128 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 129 // needs to be audited. See http://crbug.com/590369 for more details. | 129 // needs to be audited. See http://crbug.com/590369 for more details. |
| 130 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); | 130 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| 131 | 131 |
| 132 return inputMethodController().commitText( | 132 return inputMethodController().commitText( |
| 133 text, CompositionUnderlineVectorBuilder(underlines), | 133 text, CompositionUnderlineVectorBuilder(underlines), |
| 134 relativeCaretPosition); | 134 relativeCaretPosition); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void WebInputMethodControllerImpl::applySuggestionReplacement( | |
| 138 int documentMarkerID, | |
| 139 int suggestionIndex) { | |
| 140 inputMethodController().applySuggestionReplacement(documentMarkerID, | |
| 141 suggestionIndex); | |
| 142 } | |
| 143 | |
| 144 void WebInputMethodControllerImpl::deleteSuggestionHighlight() { | |
| 145 inputMethodController().deleteSuggestionHighlight(); | |
| 146 } | |
| 147 | |
| 148 void WebInputMethodControllerImpl::suggestionMenuClosed() { | |
| 149 inputMethodController().suggestionMenuClosed(); | |
| 150 } | |
| 151 | |
| 137 WebTextInputInfo WebInputMethodControllerImpl::textInputInfo() { | 152 WebTextInputInfo WebInputMethodControllerImpl::textInputInfo() { |
| 138 return frame()->inputMethodController().textInputInfo(); | 153 return frame()->inputMethodController().textInputInfo(); |
| 139 } | 154 } |
| 140 | 155 |
| 141 WebTextInputType WebInputMethodControllerImpl::textInputType() { | 156 WebTextInputType WebInputMethodControllerImpl::textInputType() { |
| 142 return frame()->inputMethodController().textInputType(); | 157 return frame()->inputMethodController().textInputType(); |
| 143 } | 158 } |
| 144 | 159 |
| 160 WebVector<WebTextSuggestionInfo> | |
| 161 WebInputMethodControllerImpl::getTextSuggestionInfosUnderCaret() { | |
| 162 return frame()->inputMethodController().getTextSuggestionInfosUnderCaret(); | |
|
rlanday
2017/01/31 19:50:22
I think all the code in this file that does frame(
| |
| 163 } | |
| 164 | |
| 165 void WebInputMethodControllerImpl::prepareForTextSuggestionMenuToBeShown() { | |
| 166 return frame() | |
| 167 ->inputMethodController() | |
| 168 .prepareForTextSuggestionMenuToBeShown(); | |
| 169 } | |
| 170 | |
| 145 LocalFrame* WebInputMethodControllerImpl::frame() const { | 171 LocalFrame* WebInputMethodControllerImpl::frame() const { |
| 146 return m_webLocalFrame->frame(); | 172 return m_webLocalFrame->frame(); |
| 147 } | 173 } |
| 148 | 174 |
| 149 InputMethodController& WebInputMethodControllerImpl::inputMethodController() | 175 InputMethodController& WebInputMethodControllerImpl::inputMethodController() |
| 150 const { | 176 const { |
| 151 return frame()->inputMethodController(); | 177 return frame()->inputMethodController(); |
| 152 } | 178 } |
| 153 | 179 |
| 154 WebPlugin* WebInputMethodControllerImpl::focusedPluginIfInputMethodSupported() | 180 WebPlugin* WebInputMethodControllerImpl::focusedPluginIfInputMethodSupported() |
| 155 const { | 181 const { |
| 156 WebPluginContainerImpl* container = | 182 WebPluginContainerImpl* container = |
| 157 WebLocalFrameImpl::currentPluginContainer(frame()); | 183 WebLocalFrameImpl::currentPluginContainer(frame()); |
| 158 if (container && container->supportsInputMethod()) | 184 if (container && container->supportsInputMethod()) |
| 159 return container->plugin(); | 185 return container->plugin(); |
| 160 return nullptr; | 186 return nullptr; |
| 161 } | 187 } |
| 162 | 188 |
| 163 } // namespace blink | 189 } // namespace blink |
| OLD | NEW |