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

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: rebase Created 4 years, 6 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 <tuple> 10 #include <tuple>
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 737
738 if (delegate_) 738 if (delegate_)
739 delegate_->LostCapture(this); 739 delegate_->LostCapture(this);
740 } 740 }
741 741
742 void RenderWidgetHostImpl::SetActive(bool active) { 742 void RenderWidgetHostImpl::SetActive(bool active) {
743 Send(new ViewMsg_SetActive(routing_id_, active)); 743 Send(new ViewMsg_SetActive(routing_id_, active));
744 } 744 }
745 745
746 void RenderWidgetHostImpl::LostMouseLock() { 746 void RenderWidgetHostImpl::LostMouseLock() {
747 Send(new ViewMsg_MouseLockLost(routing_id_));
748
749 if (delegate_) 747 if (delegate_)
750 delegate_->LostMouseLock(this); 748 delegate_->LostMouseLock(this);
751 } 749 }
752 750
751 void RenderWidgetHostImpl::SendMouseLockLost() {
752 Send(new ViewMsg_MouseLockLost(routing_id_));
753 }
754
753 void RenderWidgetHostImpl::ViewDestroyed() { 755 void RenderWidgetHostImpl::ViewDestroyed() {
754 RejectMouseLockOrUnlockIfNecessary(); 756 RejectMouseLockOrUnlockIfNecessary();
755 757
756 // TODO(evanm): tracking this may no longer be necessary; 758 // TODO(evanm): tracking this may no longer be necessary;
757 // eliminate this function if so. 759 // eliminate this function if so.
758 SetView(NULL); 760 SetView(NULL);
759 } 761 }
760 762
761 void RenderWidgetHostImpl::CopyFromBackingStore( 763 void RenderWidgetHostImpl::CopyFromBackingStore(
762 const gfx::Rect& src_subrect, 764 const gfx::Rect& src_subrect,
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1742 view_->ImeCancelComposition(); 1744 view_->ImeCancelComposition();
1743 } 1745 }
1744 1746
1745 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture, 1747 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture,
1746 bool last_unlocked_by_target, 1748 bool last_unlocked_by_target,
1747 bool privileged) { 1749 bool privileged) {
1748 if (pending_mouse_lock_request_) { 1750 if (pending_mouse_lock_request_) {
1749 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); 1751 Send(new ViewMsg_LockMouse_ACK(routing_id_, false));
1750 return; 1752 return;
1751 } 1753 }
1752 if (IsMouseLocked()) {
1753 Send(new ViewMsg_LockMouse_ACK(routing_id_, true));
1754 return;
1755 }
1756 1754
1757 pending_mouse_lock_request_ = true; 1755 pending_mouse_lock_request_ = true;
1758 if (privileged && allow_privileged_mouse_lock_) { 1756 if (privileged && allow_privileged_mouse_lock_) {
1759 // Directly approve to lock the mouse. 1757 // Directly approve to lock the mouse.
1760 GotResponseToLockMouseRequest(true); 1758 GotResponseToLockMouseRequest(true);
1761 } else { 1759 } else {
1762 if (delegate_) { 1760 if (delegate_) {
1763 delegate_->RequestToLockMouse(this, user_gesture, 1761 delegate_->RequestToLockMouse(this, user_gesture,
1764 last_unlocked_by_target); 1762 last_unlocked_by_target);
1765 return; 1763 return;
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
2165 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; 2163 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL;
2166 } 2164 }
2167 2165
2168 BrowserAccessibilityManager* 2166 BrowserAccessibilityManager*
2169 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { 2167 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() {
2170 return delegate_ ? 2168 return delegate_ ?
2171 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; 2169 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL;
2172 } 2170 }
2173 2171
2174 } // namespace content 2172 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698