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

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

Issue 535313002: Indicate user gesture for mouse down/up while pointer locked. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2533 matching lines...) Expand 10 before | Expand all | Expand 10 after
2544 } 2544 }
2545 2545
2546 void WebViewImpl::didNotAcquirePointerLock() 2546 void WebViewImpl::didNotAcquirePointerLock()
2547 { 2547 {
2548 if (page()) 2548 if (page())
2549 page()->pointerLockController().didNotAcquirePointerLock(); 2549 page()->pointerLockController().didNotAcquirePointerLock();
2550 } 2550 }
2551 2551
2552 void WebViewImpl::didLosePointerLock() 2552 void WebViewImpl::didLosePointerLock()
2553 { 2553 {
2554 m_pointerLockGestureToken.clear();
2554 if (page()) 2555 if (page())
2555 page()->pointerLockController().didLosePointerLock(); 2556 page()->pointerLockController().didLosePointerLock();
2556 } 2557 }
2557 2558
2558 void WebViewImpl::didChangeWindowResizerRect() 2559 void WebViewImpl::didChangeWindowResizerRect()
2559 { 2560 {
2560 if (mainFrameImpl()->frameView()) 2561 if (mainFrameImpl()->frameView())
2561 mainFrameImpl()->frameView()->windowResizerRectChanged(); 2562 mainFrameImpl()->frameView()->windowResizerRectChanged();
2562 } 2563 }
2563 2564
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after
4225 m_client->requestPointerUnlock(); 4226 m_client->requestPointerUnlock();
4226 } 4227 }
4227 4228
4228 bool WebViewImpl::isPointerLocked() 4229 bool WebViewImpl::isPointerLocked()
4229 { 4230 {
4230 return m_client && m_client->isPointerLocked(); 4231 return m_client && m_client->isPointerLocked();
4231 } 4232 }
4232 4233
4233 void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event) 4234 void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event)
4234 { 4235 {
4236 OwnPtr<UserGestureIndicator> gestureIndicator;
4235 AtomicString eventType; 4237 AtomicString eventType;
4236 switch (event.type) { 4238 switch (event.type) {
4237 case WebInputEvent::MouseDown: 4239 case WebInputEvent::MouseDown:
4238 eventType = EventTypeNames::mousedown; 4240 eventType = EventTypeNames::mousedown;
4241 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin gNewUserGesture));
4242 m_pointerLockGestureToken = gestureIndicator->currentToken();
4239 break; 4243 break;
4240 case WebInputEvent::MouseUp: 4244 case WebInputEvent::MouseUp:
4241 eventType = EventTypeNames::mouseup; 4245 eventType = EventTypeNames::mouseup;
4246 gestureIndicator = adoptPtr(new UserGestureIndicator(m_pointerLockGestur eToken.release()));
4242 break; 4247 break;
4243 case WebInputEvent::MouseMove: 4248 case WebInputEvent::MouseMove:
4244 eventType = EventTypeNames::mousemove; 4249 eventType = EventTypeNames::mousemove;
4245 break; 4250 break;
4246 default: 4251 default:
4247 ASSERT_NOT_REACHED(); 4252 ASSERT_NOT_REACHED();
4248 } 4253 }
4249 4254
4250 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); 4255 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event);
4251 4256
(...skipping 16 matching lines...) Expand all
4268 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4273 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4269 4274
4270 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4275 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4271 return false; 4276 return false;
4272 4277
4273 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4278 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4274 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4279 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4275 } 4280 }
4276 4281
4277 } // namespace blink 4282 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698