OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/shell/test_runner/text_input_controller.h" | 5 #include "content/shell/test_runner/text_input_controller.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "content/shell/test_runner/web_test_delegate.h" | 8 #include "content/shell/test_runner/web_test_delegate.h" |
9 #include "content/shell/test_runner/web_view_test_proxy.h" | 9 #include "content/shell/test_runner/web_view_test_proxy.h" |
10 #include "gin/arguments.h" | 10 #include "gin/arguments.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 underlines.push_back(blink::WebCompositionUnderline( | 315 underlines.push_back(blink::WebCompositionUnderline( |
316 0, textLength, SK_ColorBLACK, false, SK_ColorTRANSPARENT)); | 316 0, textLength, SK_ColorBLACK, false, SK_ColorTRANSPARENT)); |
317 if (auto* controller = GetInputMethodController()) { | 317 if (auto* controller = GetInputMethodController()) { |
318 controller->SetComposition( | 318 controller->SetComposition( |
319 newText, blink::WebVector<blink::WebCompositionUnderline>(underlines), | 319 newText, blink::WebVector<blink::WebCompositionUnderline>(underlines), |
320 blink::WebRange(), textLength, textLength); | 320 blink::WebRange(), textLength, textLength); |
321 } | 321 } |
322 } | 322 } |
323 | 323 |
324 void TextInputController::ForceTextInputStateUpdate() { | 324 void TextInputController::ForceTextInputStateUpdate() { |
| 325 // TODO(lukasza): Finish adding OOPIF support to the layout tests harness. |
325 CHECK(view()->MainFrame()->IsWebLocalFrame()) | 326 CHECK(view()->MainFrame()->IsWebLocalFrame()) |
326 << "WebView does not have a local main frame and" | 327 << "WebView does not have a local main frame and" |
327 " cannot handle input method controller tasks."; | 328 " cannot handle input method controller tasks."; |
328 web_view_test_proxy_base_->delegate()->ForceTextInputStateUpdate( | 329 web_view_test_proxy_base_->delegate()->ForceTextInputStateUpdate( |
329 view()->MainFrame()->ToWebLocalFrame()); | 330 view()->MainFrame()->ToWebLocalFrame()); |
330 } | 331 } |
331 | 332 |
332 blink::WebView* TextInputController::view() { | 333 blink::WebView* TextInputController::view() { |
333 return web_view_test_proxy_base_->web_view(); | 334 return web_view_test_proxy_base_->web_view(); |
334 } | 335 } |
335 | 336 |
336 blink::WebInputMethodController* | 337 blink::WebInputMethodController* |
337 TextInputController::GetInputMethodController() { | 338 TextInputController::GetInputMethodController() { |
338 if (!view()->MainFrame()) | 339 if (!view()->MainFrame()) |
339 return nullptr; | 340 return nullptr; |
340 | 341 |
| 342 // TODO(lukasza): Finish adding OOPIF support to the layout tests harness. |
341 CHECK(view()->MainFrame()->IsWebLocalFrame()) | 343 CHECK(view()->MainFrame()->IsWebLocalFrame()) |
342 << "WebView does not have a local main frame and" | 344 << "WebView does not have a local main frame and" |
343 " cannot handle input method controller tasks."; | 345 " cannot handle input method controller tasks."; |
344 | 346 |
345 return view() | 347 return view() |
346 ->MainFrame() | 348 ->MainFrame() |
347 ->ToWebLocalFrame() | 349 ->ToWebLocalFrame() |
348 ->FrameWidget() | 350 ->FrameWidget() |
349 ->GetActiveWebInputMethodController(); | 351 ->GetActiveWebInputMethodController(); |
350 } | 352 } |
351 | 353 |
352 } // namespace test_runner | 354 } // namespace test_runner |
OLD | NEW |