OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <queue> | 5 #include <queue> |
6 #include <set> | 6 #include <set> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 : web_contents_(web_contents) {} | 300 : web_contents_(web_contents) {} |
301 | 301 |
302 ~LeftMouseClick() { | 302 ~LeftMouseClick() { |
303 DCHECK(click_completed_); | 303 DCHECK(click_completed_); |
304 } | 304 } |
305 | 305 |
306 void Click(const gfx::Point& point, int duration_ms) { | 306 void Click(const gfx::Point& point, int duration_ms) { |
307 DCHECK(click_completed_); | 307 DCHECK(click_completed_); |
308 click_completed_ = false; | 308 click_completed_ = false; |
309 mouse_event_.type = blink::WebInputEvent::MouseDown; | 309 mouse_event_.type = blink::WebInputEvent::MouseDown; |
310 mouse_event_.button = blink::WebMouseEvent::ButtonLeft; | 310 mouse_event_.button = blink::WebMouseEvent::Button::Left; |
311 mouse_event_.x = point.x(); | 311 mouse_event_.x = point.x(); |
312 mouse_event_.y = point.y(); | 312 mouse_event_.y = point.y(); |
313 mouse_event_.modifiers = 0; | 313 mouse_event_.modifiers = 0; |
314 const gfx::Rect offset = web_contents_->GetContainerBounds(); | 314 const gfx::Rect offset = web_contents_->GetContainerBounds(); |
315 mouse_event_.globalX = point.x() + offset.x(); | 315 mouse_event_.globalX = point.x() + offset.x(); |
316 mouse_event_.globalY = point.y() + offset.y(); | 316 mouse_event_.globalY = point.y() + offset.y(); |
317 mouse_event_.clickCount = 1; | 317 mouse_event_.clickCount = 1; |
318 web_contents_->GetRenderViewHost()->GetWidget()->ForwardMouseEvent( | 318 web_contents_->GetRenderViewHost()->GetWidget()->ForwardMouseEvent( |
319 mouse_event_); | 319 mouse_event_); |
320 | 320 |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 base::StringPrintf("onAppCommand('%s');", message.c_str()))); | 769 base::StringPrintf("onAppCommand('%s');", message.c_str()))); |
770 | 770 |
771 if (listener) { | 771 if (listener) { |
772 ASSERT_TRUE(listener->WaitUntilSatisfied()); | 772 ASSERT_TRUE(listener->WaitUntilSatisfied()); |
773 } | 773 } |
774 } | 774 } |
775 | 775 |
776 void OpenContextMenu(content::WebContents* web_contents) { | 776 void OpenContextMenu(content::WebContents* web_contents) { |
777 blink::WebMouseEvent mouse_event; | 777 blink::WebMouseEvent mouse_event; |
778 mouse_event.type = blink::WebInputEvent::MouseDown; | 778 mouse_event.type = blink::WebInputEvent::MouseDown; |
779 mouse_event.button = blink::WebMouseEvent::ButtonRight; | 779 mouse_event.button = blink::WebMouseEvent::Button::Right; |
780 mouse_event.x = 1; | 780 mouse_event.x = 1; |
781 mouse_event.y = 1; | 781 mouse_event.y = 1; |
782 web_contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent( | 782 web_contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent( |
783 mouse_event); | 783 mouse_event); |
784 mouse_event.type = blink::WebInputEvent::MouseUp; | 784 mouse_event.type = blink::WebInputEvent::MouseUp; |
785 web_contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent( | 785 web_contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent( |
786 mouse_event); | 786 mouse_event); |
787 } | 787 } |
788 | 788 |
789 content::WebContents* GetGuestWebContents() { | 789 content::WebContents* GetGuestWebContents() { |
(...skipping 3026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3816 gfx::Point embedder_origin = | 3816 gfx::Point embedder_origin = |
3817 GetEmbedderWebContents()->GetContainerBounds().origin(); | 3817 GetEmbedderWebContents()->GetContainerBounds().origin(); |
3818 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); | 3818 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); |
3819 | 3819 |
3820 // Generate and send synthetic touch event. | 3820 // Generate and send synthetic touch event. |
3821 content::SimulateTouchPressAt(GetEmbedderWebContents(), | 3821 content::SimulateTouchPressAt(GetEmbedderWebContents(), |
3822 guest_rect.CenterPoint()); | 3822 guest_rect.CenterPoint()); |
3823 EXPECT_TRUE(aura_webview->HasFocus()); | 3823 EXPECT_TRUE(aura_webview->HasFocus()); |
3824 } | 3824 } |
3825 #endif | 3825 #endif |
OLD | NEW |