Chromium Code Reviews| 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 "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 Loading... | |
| 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 [](WebContents* web_contents, bool allowed) { | |
|
ncarter (slow)
2016/12/22 00:01:07
Why not:
base::Bind(base::IgnoreResult(&WebConten
lfg
2016/12/22 19:23:55
Oh, that's nice, I wasn't aware of base::IgnoreRes
| |
| 1385 web_contents->GotResponseToLockMouseRequest(allowed); | |
| 1386 }, | |
| 1387 web_contents)); | |
| 1388 } | |
| 1389 | |
| 1378 void WebViewGuest::LoadURLWithParams( | 1390 void WebViewGuest::LoadURLWithParams( |
| 1379 const GURL& url, | 1391 const GURL& url, |
| 1380 const content::Referrer& referrer, | 1392 const content::Referrer& referrer, |
| 1381 ui::PageTransition transition_type, | 1393 ui::PageTransition transition_type, |
| 1382 bool force_navigation) { | 1394 bool force_navigation) { |
| 1383 if (!url.is_valid()) { | 1395 if (!url.is_valid()) { |
| 1384 LoadAbort(true /* is_top_level */, url, net::ERR_INVALID_URL); | 1396 LoadAbort(true /* is_top_level */, url, net::ERR_INVALID_URL); |
| 1385 NavigateGuest(url::kAboutBlankURL, false /* force_navigation */); | 1397 NavigateGuest(url::kAboutBlankURL, false /* force_navigation */); |
| 1386 return; | 1398 return; |
| 1387 } | 1399 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1516 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 1528 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 1517 DispatchEventToView(base::MakeUnique<GuestViewEvent>( | 1529 DispatchEventToView(base::MakeUnique<GuestViewEvent>( |
| 1518 webview::kEventExitFullscreen, std::move(args))); | 1530 webview::kEventExitFullscreen, std::move(args))); |
| 1519 } | 1531 } |
| 1520 // Since we changed fullscreen state, sending a Resize message ensures that | 1532 // Since we changed fullscreen state, sending a Resize message ensures that |
| 1521 // renderer/ sees the change. | 1533 // renderer/ sees the change. |
| 1522 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); | 1534 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); |
| 1523 } | 1535 } |
| 1524 | 1536 |
| 1525 } // namespace extensions | 1537 } // namespace extensions |
| OLD | NEW |