| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "content/browser/compositor/test/no_transport_image_transport_factory.h
" | 33 #include "content/browser/compositor/test/no_transport_image_transport_factory.h
" |
| 34 #include "content/browser/frame_host/render_widget_host_view_guest.h" | 34 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
| 35 #include "content/browser/gpu/compositor_util.h" | 35 #include "content/browser/gpu/compositor_util.h" |
| 36 #include "content/browser/renderer_host/input/input_router.h" | 36 #include "content/browser/renderer_host/input/input_router.h" |
| 37 #include "content/browser/renderer_host/input/mouse_wheel_event_queue.h" | 37 #include "content/browser/renderer_host/input/mouse_wheel_event_queue.h" |
| 38 #include "content/browser/renderer_host/overscroll_controller.h" | 38 #include "content/browser/renderer_host/overscroll_controller.h" |
| 39 #include "content/browser/renderer_host/overscroll_controller_delegate.h" | 39 #include "content/browser/renderer_host/overscroll_controller_delegate.h" |
| 40 #include "content/browser/renderer_host/render_view_host_factory.h" | 40 #include "content/browser/renderer_host/render_view_host_factory.h" |
| 41 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 41 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
| 42 #include "content/browser/renderer_host/render_widget_host_impl.h" | 42 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 43 #include "content/browser/renderer_host/render_widget_host_view_event_handler.h" |
| 43 #include "content/browser/renderer_host/resize_lock.h" | 44 #include "content/browser/renderer_host/resize_lock.h" |
| 44 #include "content/browser/renderer_host/text_input_manager.h" | 45 #include "content/browser/renderer_host/text_input_manager.h" |
| 45 #include "content/browser/web_contents/web_contents_view_aura.h" | 46 #include "content/browser/web_contents/web_contents_view_aura.h" |
| 46 #include "content/common/host_shared_bitmap_manager.h" | 47 #include "content/common/host_shared_bitmap_manager.h" |
| 47 #include "content/common/input/synthetic_web_input_event_builders.h" | 48 #include "content/common/input/synthetic_web_input_event_builders.h" |
| 48 #include "content/common/input_messages.h" | 49 #include "content/common/input_messages.h" |
| 49 #include "content/common/text_input_state.h" | 50 #include "content/common/text_input_state.h" |
| 50 #include "content/common/view_messages.h" | 51 #include "content/common/view_messages.h" |
| 51 #include "content/public/browser/render_widget_host_view.h" | 52 #include "content/public/browser/render_widget_host_view.h" |
| 52 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" | 53 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 77 #include "ui/base/clipboard/clipboard.h" | 78 #include "ui/base/clipboard/clipboard.h" |
| 78 #include "ui/base/ui_base_types.h" | 79 #include "ui/base/ui_base_types.h" |
| 79 #include "ui/compositor/compositor.h" | 80 #include "ui/compositor/compositor.h" |
| 80 #include "ui/compositor/layer_tree_owner.h" | 81 #include "ui/compositor/layer_tree_owner.h" |
| 81 #include "ui/compositor/test/draw_waiter_for_test.h" | 82 #include "ui/compositor/test/draw_waiter_for_test.h" |
| 82 #include "ui/events/blink/blink_event_util.h" | 83 #include "ui/events/blink/blink_event_util.h" |
| 83 #include "ui/events/blink/web_input_event_traits.h" | 84 #include "ui/events/blink/web_input_event_traits.h" |
| 84 #include "ui/events/event.h" | 85 #include "ui/events/event.h" |
| 85 #include "ui/events/event_utils.h" | 86 #include "ui/events/event_utils.h" |
| 86 #include "ui/events/gesture_detection/gesture_configuration.h" | 87 #include "ui/events/gesture_detection/gesture_configuration.h" |
| 88 #include "ui/events/gestures/motion_event_aura.h" |
| 87 #include "ui/events/keycodes/dom/dom_code.h" | 89 #include "ui/events/keycodes/dom/dom_code.h" |
| 88 #include "ui/events/keycodes/dom/keycode_converter.h" | 90 #include "ui/events/keycodes/dom/keycode_converter.h" |
| 89 #include "ui/events/test/event_generator.h" | 91 #include "ui/events/test/event_generator.h" |
| 90 #include "ui/gfx/geometry/rect.h" | 92 #include "ui/gfx/geometry/rect.h" |
| 91 #include "ui/gfx/selection_bound.h" | 93 #include "ui/gfx/selection_bound.h" |
| 92 #include "ui/wm/core/default_activation_client.h" | 94 #include "ui/wm/core/default_activation_client.h" |
| 93 #include "ui/wm/core/default_screen_position_client.h" | 95 #include "ui/wm/core/default_screen_position_client.h" |
| 94 #include "ui/wm/core/window_util.h" | 96 #include "ui/wm/core/window_util.h" |
| 95 | 97 |
| 96 using testing::_; | 98 using testing::_; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 384 |
| 383 // A lock that doesn't actually do anything to the compositor, and does not | 385 // A lock that doesn't actually do anything to the compositor, and does not |
| 384 // time out. | 386 // time out. |
| 385 class FakeResizeLock : public ResizeLock { | 387 class FakeResizeLock : public ResizeLock { |
| 386 public: | 388 public: |
| 387 FakeResizeLock(const gfx::Size new_size, bool defer_compositor_lock) | 389 FakeResizeLock(const gfx::Size new_size, bool defer_compositor_lock) |
| 388 : ResizeLock(new_size, defer_compositor_lock) {} | 390 : ResizeLock(new_size, defer_compositor_lock) {} |
| 389 }; | 391 }; |
| 390 | 392 |
| 391 const ui::MotionEventAura& pointer_state_for_test() { | 393 const ui::MotionEventAura& pointer_state_for_test() { |
| 392 return pointer_state(); | 394 return event_handler()->pointer_state(); |
| 393 } | 395 } |
| 394 | 396 |
| 395 bool can_create_resize_lock_; | 397 bool can_create_resize_lock_; |
| 396 gfx::Size last_frame_size_; | 398 gfx::Size last_frame_size_; |
| 397 std::unique_ptr<cc::CopyOutputRequest> last_copy_request_; | 399 std::unique_ptr<cc::CopyOutputRequest> last_copy_request_; |
| 398 FakeWindowEventDispatcher* dispatcher_; | 400 FakeWindowEventDispatcher* dispatcher_; |
| 399 }; | 401 }; |
| 400 | 402 |
| 401 // A layout manager that always resizes a child to the root window size. | 403 // A layout manager that always resizes a child to the root window size. |
| 402 class FullscreenLayoutManager : public aura::LayoutManager { | 404 class FullscreenLayoutManager : public aura::LayoutManager { |
| (...skipping 4079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4482 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT); | 4484 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT); |
| 4483 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_call, processes_[index], | 4485 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_call, processes_[index], |
| 4484 InputMsg_ImeCommitText::ID)); | 4486 InputMsg_ImeCommitText::ID)); |
| 4485 } | 4487 } |
| 4486 } | 4488 } |
| 4487 | 4489 |
| 4488 // This test is for RenderWidgetHostViewAura::FinishImeCompositionSession which | 4490 // This test is for RenderWidgetHostViewAura::FinishImeCompositionSession which |
| 4489 // is in response to a mouse click during an ongoing composition. | 4491 // is in response to a mouse click during an ongoing composition. |
| 4490 TEST_F(InputMethodResultAuraTest, FinishImeCompositionSession) { | 4492 TEST_F(InputMethodResultAuraTest, FinishImeCompositionSession) { |
| 4491 base::Closure ime_finish_session_call = | 4493 base::Closure ime_finish_session_call = |
| 4492 base::Bind(&RenderWidgetHostViewAura::FinishImeCompositionSession, | 4494 base::Bind(&RenderWidgetHostViewEventHandler::FinishImeCompositionSession, |
| 4493 base::Unretained(tab_view())); | 4495 base::Unretained(tab_view()->event_handler())); |
| 4494 for (auto index : active_view_sequence_) { | 4496 for (auto index : active_view_sequence_) { |
| 4495 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT); | 4497 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT); |
| 4496 SetHasCompositionTextToTrue(); | 4498 SetHasCompositionTextToTrue(); |
| 4497 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_finish_session_call, | 4499 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_finish_session_call, |
| 4498 processes_[index], | 4500 processes_[index], |
| 4499 InputMsg_ImeFinishComposingText::ID)); | 4501 InputMsg_ImeFinishComposingText::ID)); |
| 4500 } | 4502 } |
| 4501 } | 4503 } |
| 4502 | 4504 |
| 4503 // This test is for ui::TextInputClient::ChangeTextDirectionAndLayoutAlignment. | 4505 // This test is for ui::TextInputClient::ChangeTextDirectionAndLayoutAlignment. |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4675 | 4677 |
| 4676 // Retrieve the selected text from clipboard and verify it is as expected. | 4678 // Retrieve the selected text from clipboard and verify it is as expected. |
| 4677 base::string16 result_text; | 4679 base::string16 result_text; |
| 4678 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); | 4680 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); |
| 4679 EXPECT_EQ(expected_text, result_text); | 4681 EXPECT_EQ(expected_text, result_text); |
| 4680 } | 4682 } |
| 4681 } | 4683 } |
| 4682 #endif | 4684 #endif |
| 4683 | 4685 |
| 4684 } // namespace content | 4686 } // namespace content |
| OLD | NEW |