| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 content::WebContents* web_contents = GetActiveWebContents(); | 420 content::WebContents* web_contents = GetActiveWebContents(); |
| 421 EXPECT_TRUE(ObserveFlashHasFocus(web_contents, true)); | 421 EXPECT_TRUE(ObserveFlashHasFocus(web_contents, true)); |
| 422 | 422 |
| 423 // Try to lock the mouse. | 423 // Try to lock the mouse. |
| 424 content::RenderWidgetHostView* fullscreen_view = | 424 content::RenderWidgetHostView* fullscreen_view = |
| 425 web_contents->GetFullscreenRenderWidgetHostView(); | 425 web_contents->GetFullscreenRenderWidgetHostView(); |
| 426 content::RenderWidgetHost* fullscreen_widget = | 426 content::RenderWidgetHost* fullscreen_widget = |
| 427 fullscreen_view->GetRenderWidgetHost(); | 427 fullscreen_view->GetRenderWidgetHost(); |
| 428 content::RenderProcessHost* process = fullscreen_widget->GetProcess(); | 428 content::RenderProcessHost* process = fullscreen_widget->GetProcess(); |
| 429 content::PwnMessageHelper::LockMouse( | 429 content::PwnMessageHelper::LockMouse( |
| 430 process, fullscreen_widget->GetRoutingID(), true, false, true); | 430 process, fullscreen_widget->GetRoutingID(), true, true); |
| 431 | 431 |
| 432 // Make sure that the fullscreen widget got the mouse lock. | 432 // Make sure that the fullscreen widget got the mouse lock. |
| 433 EXPECT_TRUE(fullscreen_view->IsMouseLocked()); | 433 EXPECT_TRUE(fullscreen_view->IsMouseLocked()); |
| 434 EXPECT_EQ(fullscreen_widget, content::GetMouseLockWidget(web_contents)); | 434 EXPECT_EQ(fullscreen_widget, content::GetMouseLockWidget(web_contents)); |
| 435 | 435 |
| 436 PressEscape(); | 436 PressEscape(); |
| 437 EXPECT_TRUE(ObserveTabIsInFullscreen(false)); | 437 EXPECT_TRUE(ObserveTabIsInFullscreen(false)); |
| 438 | 438 |
| 439 // Mouse should be unlocked. | 439 // Mouse should be unlocked. |
| 440 EXPECT_EQ(nullptr, content::GetMouseLockWidget(web_contents)); | 440 EXPECT_EQ(nullptr, content::GetMouseLockWidget(web_contents)); |
| 441 } | 441 } |
| OLD | NEW |