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

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_guest.cc

Issue 2591783003: Implement pointer lock across outer/inner WebContents. (Closed)
Patch Set: rebase Created 3 years, 11 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
OLDNEW
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 "extensions/browser/guest_view/web_view/web_view_guest.h" 5 #include "extensions/browser/guest_view/web_view/web_view_guest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 1368
1369 void WebViewGuest::ExitFullscreenModeForTab(WebContents* web_contents) { 1369 void WebViewGuest::ExitFullscreenModeForTab(WebContents* web_contents) {
1370 SetFullscreenState(false); 1370 SetFullscreenState(false);
1371 } 1371 }
1372 1372
1373 bool WebViewGuest::IsFullscreenForTabOrPending( 1373 bool WebViewGuest::IsFullscreenForTabOrPending(
1374 const WebContents* web_contents) const { 1374 const WebContents* web_contents) const {
1375 return is_guest_fullscreen_; 1375 return is_guest_fullscreen_;
1376 } 1376 }
1377 1377
1378 void WebViewGuest::RequestToLockMouse(WebContents* web_contents,
1379 bool user_gesture,
1380 bool last_unlocked_by_target) {
1381 RequestPointerLockPermission(
1382 user_gesture, last_unlocked_by_target,
1383 base::Bind(
1384 base::IgnoreResult(&WebContents::GotResponseToLockMouseRequest),
1385 base::Unretained(web_contents)));
1386 }
1387
1378 void WebViewGuest::LoadURLWithParams( 1388 void WebViewGuest::LoadURLWithParams(
1379 const GURL& url, 1389 const GURL& url,
1380 const content::Referrer& referrer, 1390 const content::Referrer& referrer,
1381 ui::PageTransition transition_type, 1391 ui::PageTransition transition_type,
1382 bool force_navigation) { 1392 bool force_navigation) {
1383 if (!url.is_valid()) { 1393 if (!url.is_valid()) {
1384 LoadAbort(true /* is_top_level */, url, net::ERR_INVALID_URL); 1394 LoadAbort(true /* is_top_level */, url, net::ERR_INVALID_URL);
1385 NavigateGuest(url::kAboutBlankURL, false /* force_navigation */); 1395 NavigateGuest(url::kAboutBlankURL, false /* force_navigation */);
1386 return; 1396 return;
1387 } 1397 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); 1526 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue());
1517 DispatchEventToView(base::MakeUnique<GuestViewEvent>( 1527 DispatchEventToView(base::MakeUnique<GuestViewEvent>(
1518 webview::kEventExitFullscreen, std::move(args))); 1528 webview::kEventExitFullscreen, std::move(args)));
1519 } 1529 }
1520 // Since we changed fullscreen state, sending a Resize message ensures that 1530 // Since we changed fullscreen state, sending a Resize message ensures that
1521 // renderer/ sees the change. 1531 // renderer/ sees the change.
1522 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); 1532 web_contents()->GetRenderViewHost()->GetWidget()->WasResized();
1523 } 1533 }
1524 1534
1525 } // namespace extensions 1535 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698