Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: chrome/browser/apps/guest_view/web_view_browsertest.cc

Issue 2227563003: Refactoring button field and its type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix new instances Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698