| 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 3991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4394 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT); | 4396 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT); |
| 4395 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_call, processes_[index], | 4397 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_call, processes_[index], |
| 4396 InputMsg_ImeCommitText::ID)); | 4398 InputMsg_ImeCommitText::ID)); |
| 4397 } | 4399 } |
| 4398 } | 4400 } |
| 4399 | 4401 |
| 4400 // This test is for RenderWidgetHostViewAura::FinishImeCompositionSession which | 4402 // This test is for RenderWidgetHostViewAura::FinishImeCompositionSession which |
| 4401 // is in response to a mouse click during an ongoing composition. | 4403 // is in response to a mouse click during an ongoing composition. |
| 4402 TEST_F(InputMethodResultAuraTest, FinishImeCompositionSession) { | 4404 TEST_F(InputMethodResultAuraTest, FinishImeCompositionSession) { |
| 4403 base::Closure ime_finish_session_call = | 4405 base::Closure ime_finish_session_call = |
| 4404 base::Bind(&RenderWidgetHostViewAura::FinishImeCompositionSession, | 4406 base::Bind(&RenderWidgetHostViewEventHandler::FinishImeCompositionSession, |
| 4405 base::Unretained(tab_view())); | 4407 base::Unretained(tab_view()->event_handler())); |
| 4406 for (auto index : active_view_sequence_) { | 4408 for (auto index : active_view_sequence_) { |
| 4407 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT); | 4409 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT); |
| 4408 SetHasCompositionTextToTrue(); | 4410 SetHasCompositionTextToTrue(); |
| 4409 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_finish_session_call, | 4411 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_finish_session_call, |
| 4410 processes_[index], | 4412 processes_[index], |
| 4411 InputMsg_ImeFinishComposingText::ID)); | 4413 InputMsg_ImeFinishComposingText::ID)); |
| 4412 } | 4414 } |
| 4413 } | 4415 } |
| 4414 | 4416 |
| 4415 // This test is for ui::TextInputClient::ChangeTextDirectionAndLayoutAlignment. | 4417 // This test is for ui::TextInputClient::ChangeTextDirectionAndLayoutAlignment. |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4587 | 4589 |
| 4588 // Retrieve the selected text from clipboard and verify it is as expected. | 4590 // Retrieve the selected text from clipboard and verify it is as expected. |
| 4589 base::string16 result_text; | 4591 base::string16 result_text; |
| 4590 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); | 4592 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); |
| 4591 EXPECT_EQ(expected_text, result_text); | 4593 EXPECT_EQ(expected_text, result_text); |
| 4592 } | 4594 } |
| 4593 } | 4595 } |
| 4594 #endif | 4596 #endif |
| 4595 | 4597 |
| 4596 } // namespace content | 4598 } // namespace content |
| OLD | NEW |