| 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 "content/public/test/text_input_test_utils.h" | 5 #include "content/public/test/text_input_test_utils.h" |
| 6 | 6 |
| 7 #include <unordered_set> | 7 #include <unordered_set> |
| 8 | 8 |
| 9 #include "content/browser/renderer_host/render_widget_host_impl.h" | 9 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 10 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 10 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 244 |
| 245 return true; | 245 return true; |
| 246 } | 246 } |
| 247 | 247 |
| 248 bool RequestCompositionInfoFromActiveWidget(WebContents* web_contents) { | 248 bool RequestCompositionInfoFromActiveWidget(WebContents* web_contents) { |
| 249 TextInputManager* manager = | 249 TextInputManager* manager = |
| 250 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager(); | 250 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager(); |
| 251 if (!manager || !manager->GetActiveWidget()) | 251 if (!manager || !manager->GetActiveWidget()) |
| 252 return false; | 252 return false; |
| 253 | 253 |
| 254 manager->GetActiveWidget()->Send(new InputMsg_RequestCompositionUpdate( | 254 manager->GetActiveWidget()->Send(new InputMsg_ImeRequestCompositionUpdate( |
| 255 manager->GetActiveWidget()->GetRoutingID(), true, false)); | 255 manager->GetActiveWidget()->GetRoutingID(), true, false)); |
| 256 return true; | 256 return true; |
| 257 } | 257 } |
| 258 | 258 |
| 259 size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents) { | 259 size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents) { |
| 260 std::unordered_set<RenderWidgetHostView*> views; | 260 std::unordered_set<RenderWidgetHostView*> views; |
| 261 TextInputManager* manager = | 261 TextInputManager* manager = |
| 262 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager(); | 262 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager(); |
| 263 return !!manager ? manager->GetRegisteredViewsCountForTesting() : 0; | 263 return !!manager ? manager->GetRegisteredViewsCountForTesting() : 0; |
| 264 } | 264 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 405 |
| 406 #ifdef USE_AURA | 406 #ifdef USE_AURA |
| 407 RenderWidgetHostViewAura* view = static_cast<RenderWidgetHostViewAura*>( | 407 RenderWidgetHostViewAura* view = static_cast<RenderWidgetHostViewAura*>( |
| 408 web_contents->GetRenderWidgetHostView()); | 408 web_contents->GetRenderWidgetHostView()); |
| 409 observer.reset(new InputMethodObserverAura(view->GetInputMethod())); | 409 observer.reset(new InputMethodObserverAura(view->GetInputMethod())); |
| 410 #endif | 410 #endif |
| 411 return observer; | 411 return observer; |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace content | 414 } // namespace content |
| OLD | NEW |