| 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 "core/exported/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/CompositionUnderlineVectorBuilder.h" | 9 #include "core/editing/CompositionUnderlineVectorBuilder.h" |
| 10 #include "core/editing/EditingUtilities.h" | 10 #include "core/editing/EditingUtilities.h" |
| 11 #include "core/editing/Editor.h" | 11 #include "core/editing/Editor.h" |
| 12 #include "core/editing/EphemeralRange.h" | 12 #include "core/editing/EphemeralRange.h" |
| 13 #include "core/editing/FrameSelection.h" | 13 #include "core/editing/FrameSelection.h" |
| 14 #include "core/editing/InputMethodController.h" | 14 #include "core/editing/InputMethodController.h" |
| 15 #include "core/editing/PlainTextRange.h" | 15 #include "core/editing/PlainTextRange.h" |
| 16 #include "core/exported/WebPluginContainerBase.h" | 16 #include "core/exported/WebPluginContainerBase.h" |
| 17 #include "core/frame/LocalFrame.h" | 17 #include "core/frame/LocalFrame.h" |
| 18 #include "core/frame/WebLocalFrameBase.h" |
| 18 #include "core/page/FocusController.h" | 19 #include "core/page/FocusController.h" |
| 19 #include "core/page/Page.h" | 20 #include "core/page/Page.h" |
| 20 #include "platform/UserGestureIndicator.h" | 21 #include "platform/UserGestureIndicator.h" |
| 21 #include "public/platform/WebString.h" | 22 #include "public/platform/WebString.h" |
| 22 #include "public/web/WebPlugin.h" | 23 #include "public/web/WebPlugin.h" |
| 23 #include "public/web/WebRange.h" | 24 #include "public/web/WebRange.h" |
| 24 #include "web/WebLocalFrameImpl.h" | |
| 25 | 25 |
| 26 namespace blink { | 26 namespace blink { |
| 27 | 27 |
| 28 WebInputMethodControllerImpl::WebInputMethodControllerImpl( | 28 WebInputMethodControllerImpl::WebInputMethodControllerImpl( |
| 29 WebLocalFrameImpl* web_local_frame) | 29 WebLocalFrameBase* web_local_frame) |
| 30 : web_local_frame_(web_local_frame) {} | 30 : web_local_frame_(web_local_frame) {} |
| 31 | 31 |
| 32 WebInputMethodControllerImpl::~WebInputMethodControllerImpl() {} | 32 WebInputMethodControllerImpl::~WebInputMethodControllerImpl() {} |
| 33 | 33 |
| 34 // static | |
| 35 WebInputMethodControllerImpl* WebInputMethodControllerImpl::FromFrame( | |
| 36 LocalFrame* frame) { | |
| 37 WebLocalFrameImpl* web_local_frame_impl = WebLocalFrameImpl::FromFrame(frame); | |
| 38 return web_local_frame_impl ? web_local_frame_impl->GetInputMethodController() | |
| 39 : nullptr; | |
| 40 } | |
| 41 | |
| 42 DEFINE_TRACE(WebInputMethodControllerImpl) { | 34 DEFINE_TRACE(WebInputMethodControllerImpl) { |
| 43 visitor->Trace(web_local_frame_); | 35 visitor->Trace(web_local_frame_); |
| 44 } | 36 } |
| 45 | 37 |
| 46 bool WebInputMethodControllerImpl::SetComposition( | 38 bool WebInputMethodControllerImpl::SetComposition( |
| 47 const WebString& text, | 39 const WebString& text, |
| 48 const WebVector<WebCompositionUnderline>& underlines, | 40 const WebVector<WebCompositionUnderline>& underlines, |
| 49 const WebRange& replacement_range, | 41 const WebRange& replacement_range, |
| 50 int selection_start, | 42 int selection_start, |
| 51 int selection_end) { | 43 int selection_end) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 WebPlugin* WebInputMethodControllerImpl::FocusedPluginIfInputMethodSupported() | 151 WebPlugin* WebInputMethodControllerImpl::FocusedPluginIfInputMethodSupported() |
| 160 const { | 152 const { |
| 161 WebPluginContainerBase* container = GetFrame()->GetWebPluginContainerBase(); | 153 WebPluginContainerBase* container = GetFrame()->GetWebPluginContainerBase(); |
| 162 if (container && container->SupportsInputMethod()) { | 154 if (container && container->SupportsInputMethod()) { |
| 163 return container->Plugin(); | 155 return container->Plugin(); |
| 164 } | 156 } |
| 165 return nullptr; | 157 return nullptr; |
| 166 } | 158 } |
| 167 | 159 |
| 168 } // namespace blink | 160 } // namespace blink |
| OLD | NEW |