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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1980133002: Implement pointer lock API for out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removing one more override Created 4 years, 7 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 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 #include "public/platform/WebScheduler.h" 131 #include "public/platform/WebScheduler.h"
132 #include "public/platform/WebURLRequest.h" 132 #include "public/platform/WebURLRequest.h"
133 #include "public/platform/WebVector.h" 133 #include "public/platform/WebVector.h"
134 #include "public/platform/WebViewScheduler.h" 134 #include "public/platform/WebViewScheduler.h"
135 #include "public/web/WebAXObject.h" 135 #include "public/web/WebAXObject.h"
136 #include "public/web/WebActiveWheelFlingParameters.h" 136 #include "public/web/WebActiveWheelFlingParameters.h"
137 #include "public/web/WebAutofillClient.h" 137 #include "public/web/WebAutofillClient.h"
138 #include "public/web/WebElement.h" 138 #include "public/web/WebElement.h"
139 #include "public/web/WebFrame.h" 139 #include "public/web/WebFrame.h"
140 #include "public/web/WebFrameClient.h" 140 #include "public/web/WebFrameClient.h"
141 #include "public/web/WebFrameWidget.h"
141 #include "public/web/WebHitTestResult.h" 142 #include "public/web/WebHitTestResult.h"
142 #include "public/web/WebInputElement.h" 143 #include "public/web/WebInputElement.h"
143 #include "public/web/WebMeaningfulLayout.h" 144 #include "public/web/WebMeaningfulLayout.h"
144 #include "public/web/WebMediaPlayerAction.h" 145 #include "public/web/WebMediaPlayerAction.h"
145 #include "public/web/WebNode.h" 146 #include "public/web/WebNode.h"
146 #include "public/web/WebPlugin.h" 147 #include "public/web/WebPlugin.h"
147 #include "public/web/WebPluginAction.h" 148 #include "public/web/WebPluginAction.h"
148 #include "public/web/WebRange.h" 149 #include "public/web/WebRange.h"
149 #include "public/web/WebSelection.h" 150 #include "public/web/WebSelection.h"
150 #include "public/web/WebTextInputInfo.h" 151 #include "public/web/WebTextInputInfo.h"
(...skipping 4268 matching lines...) Expand 10 before | Expand all | Expand 10 after
4419 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast< int>(visibilityState)), isInitialState); 4420 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast< int>(visibilityState)), isInitialState);
4420 4421
4421 bool visible = visibilityState == WebPageVisibilityStateVisible; 4422 bool visible = visibilityState == WebPageVisibilityStateVisible;
4422 if (m_layerTreeView) 4423 if (m_layerTreeView)
4423 m_layerTreeView->setVisible(visible); 4424 m_layerTreeView->setVisible(visible);
4424 m_scheduler->setPageVisible(visible); 4425 m_scheduler->setPageVisible(visible);
4425 } 4426 }
4426 4427
4427 bool WebViewImpl::requestPointerLock() 4428 bool WebViewImpl::requestPointerLock()
4428 { 4429 {
4429 return m_client && m_client->requestPointerLock(); 4430 return mainFrameImpl()->frameWidget() && mainFrameImpl()->frameWidget()->cli ent() && mainFrameImpl()->frameWidget()->client()->requestPointerLock();
scheib 2016/05/19 00:38:58 These && chains are too long.. let's do: if (widg
lfg 2016/05/19 23:54:06 Done.
4430 } 4431 }
4431 4432
4432 void WebViewImpl::requestPointerUnlock() 4433 void WebViewImpl::requestPointerUnlock()
4433 { 4434 {
4434 if (m_client) 4435 if (mainFrameImpl()->frameWidget() && mainFrameImpl()->frameWidget()->client ())
4435 m_client->requestPointerUnlock(); 4436 mainFrameImpl()->frameWidget()->client()->requestPointerUnlock();
4436 } 4437 }
4437 4438
4438 bool WebViewImpl::isPointerLocked() 4439 bool WebViewImpl::isPointerLocked()
4439 { 4440 {
4440 return m_client && m_client->isPointerLocked(); 4441 return mainFrameImpl()->frameWidget() && mainFrameImpl()->frameWidget()->cli ent() && mainFrameImpl()->frameWidget()->client()->isPointerLocked();
4441 } 4442 }
4442 4443
4443 void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event) 4444 void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event)
4444 { 4445 {
4445 OwnPtr<UserGestureIndicator> gestureIndicator; 4446 OwnPtr<UserGestureIndicator> gestureIndicator;
4446 AtomicString eventType; 4447 AtomicString eventType;
4447 switch (event.type) { 4448 switch (event.type) {
4448 case WebInputEvent::MouseDown: 4449 case WebInputEvent::MouseDown:
4449 eventType = EventTypeNames::mousedown; 4450 eventType = EventTypeNames::mousedown;
4450 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin gNewUserGesture)); 4451 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin gNewUserGesture));
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
4524 { 4525 {
4525 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4526 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4526 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4527 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4527 if (!page()) 4528 if (!page())
4528 return 1; 4529 return 1;
4529 4530
4530 return page()->deviceScaleFactor(); 4531 return page()->deviceScaleFactor();
4531 } 4532 }
4532 4533
4533 } // namespace blink 4534 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698