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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 1980133002: Implement pointer lock API for out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 735
736 if (delegate_) 736 if (delegate_)
737 delegate_->LostCapture(this); 737 delegate_->LostCapture(this);
738 } 738 }
739 739
740 void RenderWidgetHostImpl::SetActive(bool active) { 740 void RenderWidgetHostImpl::SetActive(bool active) {
741 Send(new ViewMsg_SetActive(routing_id_, active)); 741 Send(new ViewMsg_SetActive(routing_id_, active));
742 } 742 }
743 743
744 void RenderWidgetHostImpl::LostMouseLock() { 744 void RenderWidgetHostImpl::LostMouseLock() {
745 Send(new ViewMsg_MouseLockLost(routing_id_));
746
747 if (delegate_) 745 if (delegate_)
748 delegate_->LostMouseLock(this); 746 delegate_->LostMouseLock(this);
749 } 747 }
750 748
749 void RenderWidgetHostImpl::SendMouseLockLost() {
750 Send(new ViewMsg_MouseLockLost(routing_id_));
751 }
752
751 void RenderWidgetHostImpl::ViewDestroyed() { 753 void RenderWidgetHostImpl::ViewDestroyed() {
752 RejectMouseLockOrUnlockIfNecessary(); 754 RejectMouseLockOrUnlockIfNecessary();
753 755
754 // TODO(evanm): tracking this may no longer be necessary; 756 // TODO(evanm): tracking this may no longer be necessary;
755 // eliminate this function if so. 757 // eliminate this function if so.
756 SetView(NULL); 758 SetView(NULL);
757 } 759 }
758 760
759 void RenderWidgetHostImpl::CopyFromBackingStore( 761 void RenderWidgetHostImpl::CopyFromBackingStore(
760 const gfx::Rect& src_subrect, 762 const gfx::Rect& src_subrect,
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 view_->ImeCancelComposition(); 1733 view_->ImeCancelComposition();
1732 } 1734 }
1733 1735
1734 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture, 1736 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture,
1735 bool last_unlocked_by_target, 1737 bool last_unlocked_by_target,
1736 bool privileged) { 1738 bool privileged) {
1737 if (pending_mouse_lock_request_) { 1739 if (pending_mouse_lock_request_) {
1738 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); 1740 Send(new ViewMsg_LockMouse_ACK(routing_id_, false));
1739 return; 1741 return;
1740 } 1742 }
1741 if (IsMouseLocked()) {
1742 Send(new ViewMsg_LockMouse_ACK(routing_id_, true));
1743 return;
1744 }
1745 1743
1746 pending_mouse_lock_request_ = true; 1744 pending_mouse_lock_request_ = true;
1747 if (privileged && allow_privileged_mouse_lock_) { 1745 if (privileged && allow_privileged_mouse_lock_) {
1748 // Directly approve to lock the mouse. 1746 // Directly approve to lock the mouse.
1749 GotResponseToLockMouseRequest(true); 1747 GotResponseToLockMouseRequest(true);
1750 } else { 1748 } else {
1751 if (delegate_) { 1749 if (delegate_) {
1752 delegate_->RequestToLockMouse(this, user_gesture, 1750 delegate_->RequestToLockMouse(this, user_gesture,
1753 last_unlocked_by_target); 1751 last_unlocked_by_target);
1754 return; 1752 return;
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
2151 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; 2149 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL;
2152 } 2150 }
2153 2151
2154 BrowserAccessibilityManager* 2152 BrowserAccessibilityManager*
2155 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { 2153 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() {
2156 return delegate_ ? 2154 return delegate_ ?
2157 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; 2155 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL;
2158 } 2156 }
2159 2157
2160 } // namespace content 2158 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698