| 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 "core/exported/WebInputMethodControllerImpl.h" | 5 #include "core/exported/WebInputMethodControllerImpl.h" |
| 6 | 6 |
| 7 #include "core/InputTypeNames.h" | 7 #include "core/InputTypeNames.h" |
| 8 #include "core/dom/Document.h" |
| 8 #include "core/dom/UserGestureIndicator.h" | 9 #include "core/dom/UserGestureIndicator.h" |
| 9 #include "core/editing/CompositionUnderlineVectorBuilder.h" | 10 #include "core/editing/CompositionUnderlineVectorBuilder.h" |
| 10 #include "core/editing/EditingUtilities.h" | 11 #include "core/editing/EditingUtilities.h" |
| 11 #include "core/editing/Editor.h" | 12 #include "core/editing/Editor.h" |
| 12 #include "core/editing/EphemeralRange.h" | 13 #include "core/editing/EphemeralRange.h" |
| 13 #include "core/editing/FrameSelection.h" | 14 #include "core/editing/FrameSelection.h" |
| 14 #include "core/editing/InputMethodController.h" | 15 #include "core/editing/InputMethodController.h" |
| 15 #include "core/editing/PlainTextRange.h" | 16 #include "core/editing/PlainTextRange.h" |
| 16 #include "core/exported/WebPluginContainerImpl.h" | 17 #include "core/exported/WebPluginContainerImpl.h" |
| 17 #include "core/frame/LocalFrame.h" | 18 #include "core/frame/LocalFrame.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 132 } |
| 132 | 133 |
| 133 WebTextInputInfo WebInputMethodControllerImpl::TextInputInfo() { | 134 WebTextInputInfo WebInputMethodControllerImpl::TextInputInfo() { |
| 134 return GetFrame()->GetInputMethodController().TextInputInfo(); | 135 return GetFrame()->GetInputMethodController().TextInputInfo(); |
| 135 } | 136 } |
| 136 | 137 |
| 137 WebTextInputType WebInputMethodControllerImpl::TextInputType() { | 138 WebTextInputType WebInputMethodControllerImpl::TextInputType() { |
| 138 return GetFrame()->GetInputMethodController().TextInputType(); | 139 return GetFrame()->GetInputMethodController().TextInputType(); |
| 139 } | 140 } |
| 140 | 141 |
| 142 WebRange WebInputMethodControllerImpl::GetSelectionOffsets() const { |
| 143 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 144 // needs to be audited. See http://crbug.com/590369 for more details. |
| 145 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); |
| 146 |
| 147 return GetFrame()->GetInputMethodController().GetSelectionOffsets(); |
| 148 } |
| 149 |
| 141 LocalFrame* WebInputMethodControllerImpl::GetFrame() const { | 150 LocalFrame* WebInputMethodControllerImpl::GetFrame() const { |
| 142 return web_frame_->GetFrame(); | 151 return web_frame_->GetFrame(); |
| 143 } | 152 } |
| 144 | 153 |
| 145 InputMethodController& WebInputMethodControllerImpl::GetInputMethodController() | 154 InputMethodController& WebInputMethodControllerImpl::GetInputMethodController() |
| 146 const { | 155 const { |
| 147 return GetFrame()->GetInputMethodController(); | 156 return GetFrame()->GetInputMethodController(); |
| 148 } | 157 } |
| 149 | 158 |
| 150 WebPlugin* WebInputMethodControllerImpl::FocusedPluginIfInputMethodSupported() | 159 WebPlugin* WebInputMethodControllerImpl::FocusedPluginIfInputMethodSupported() |
| 151 const { | 160 const { |
| 152 WebPluginContainerImpl* container = GetFrame()->GetWebPluginContainer(); | 161 WebPluginContainerImpl* container = GetFrame()->GetWebPluginContainer(); |
| 153 if (container && container->SupportsInputMethod()) { | 162 if (container && container->SupportsInputMethod()) { |
| 154 return container->Plugin(); | 163 return container->Plugin(); |
| 155 } | 164 } |
| 156 return nullptr; | 165 return nullptr; |
| 157 } | 166 } |
| 158 | 167 |
| 159 } // namespace blink | 168 } // namespace blink |
| OLD | NEW |