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

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

Issue 10443045: Silent mouse lock after unlock by target (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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 <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 1033
1034 void RenderWidgetHostImpl::ImeCancelComposition() { 1034 void RenderWidgetHostImpl::ImeCancelComposition() {
1035 Send(new ViewMsg_ImeSetComposition(GetRoutingID(), string16(), 1035 Send(new ViewMsg_ImeSetComposition(GetRoutingID(), string16(),
1036 std::vector<WebKit::WebCompositionUnderline>(), 0, 0)); 1036 std::vector<WebKit::WebCompositionUnderline>(), 0, 0));
1037 } 1037 }
1038 1038
1039 gfx::Rect RenderWidgetHostImpl::GetRootWindowResizerRect() const { 1039 gfx::Rect RenderWidgetHostImpl::GetRootWindowResizerRect() const {
1040 return gfx::Rect(); 1040 return gfx::Rect();
1041 } 1041 }
1042 1042
1043 void RenderWidgetHostImpl::RequestToLockMouse(bool /* user_gesture */) { 1043 void RenderWidgetHostImpl::RequestToLockMouse(bool /* user_gesture */,
1044 bool /* after_unlocked_by_target */) {
1044 // Directly reject to lock the mouse. Subclass can override this method to 1045 // Directly reject to lock the mouse. Subclass can override this method to
1045 // decide whether to allow mouse lock or not. 1046 // decide whether to allow mouse lock or not.
1046 GotResponseToLockMouseRequest(false); 1047 GotResponseToLockMouseRequest(false);
1047 } 1048 }
1048 1049
1049 void RenderWidgetHostImpl::RejectMouseLockOrUnlockIfNecessary() { 1050 void RenderWidgetHostImpl::RejectMouseLockOrUnlockIfNecessary() {
1050 DCHECK(!pending_mouse_lock_request_ || !IsMouseLocked()); 1051 DCHECK(!pending_mouse_lock_request_ || !IsMouseLocked());
1051 if (pending_mouse_lock_request_) { 1052 if (pending_mouse_lock_request_) {
1052 pending_mouse_lock_request_ = false; 1053 pending_mouse_lock_request_ = false;
1053 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); 1054 Send(new ViewMsg_LockMouse_ACK(routing_id_, false));
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 void RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing( 1479 void RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing(
1479 bool activated) { 1480 bool activated) {
1480 TRACE_EVENT1("renderer_host", 1481 TRACE_EVENT1("renderer_host",
1481 "RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing", 1482 "RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing",
1482 "activated", activated); 1483 "activated", activated);
1483 is_accelerated_compositing_active_ = activated; 1484 is_accelerated_compositing_active_ = activated;
1484 if (view_) 1485 if (view_)
1485 view_->OnAcceleratedCompositingStateChange(); 1486 view_->OnAcceleratedCompositingStateChange();
1486 } 1487 }
1487 1488
1488 void RenderWidgetHostImpl::OnMsgLockMouse(bool user_gesture) { 1489 void RenderWidgetHostImpl::OnMsgLockMouse(bool user_gesture,
1490 bool after_unlocked_by_target) {
1489 if (pending_mouse_lock_request_) { 1491 if (pending_mouse_lock_request_) {
1490 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); 1492 Send(new ViewMsg_LockMouse_ACK(routing_id_, false));
1491 return; 1493 return;
1492 } else if (IsMouseLocked()) { 1494 } else if (IsMouseLocked()) {
1493 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); 1495 Send(new ViewMsg_LockMouse_ACK(routing_id_, true));
1494 return; 1496 return;
1495 } 1497 }
1496 1498
1497 pending_mouse_lock_request_ = true; 1499 pending_mouse_lock_request_ = true;
1498 RequestToLockMouse(user_gesture); 1500 RequestToLockMouse(user_gesture, after_unlocked_by_target);
1499 } 1501 }
1500 1502
1501 void RenderWidgetHostImpl::OnMsgUnlockMouse() { 1503 void RenderWidgetHostImpl::OnMsgUnlockMouse() {
1502 RejectMouseLockOrUnlockIfNecessary(); 1504 RejectMouseLockOrUnlockIfNecessary();
1503 } 1505 }
1504 1506
1505 #if defined(OS_POSIX) || defined(USE_AURA) 1507 #if defined(OS_POSIX) || defined(USE_AURA)
1506 void RenderWidgetHostImpl::OnMsgGetWindowRect(gfx::NativeViewId window_id, 1508 void RenderWidgetHostImpl::OnMsgGetWindowRect(gfx::NativeViewId window_id,
1507 gfx::Rect* results) { 1509 gfx::Rect* results) {
1508 if (view_) 1510 if (view_)
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1784 // indicate that no callback is in progress (i.e. without this line 1786 // indicate that no callback is in progress (i.e. without this line
1785 // DelayedAutoResized will not get called again). 1787 // DelayedAutoResized will not get called again).
1786 new_auto_size_.SetSize(0, 0); 1788 new_auto_size_.SetSize(0, 0);
1787 if (!should_auto_resize_) 1789 if (!should_auto_resize_)
1788 return; 1790 return;
1789 1791
1790 OnRenderAutoResized(new_size); 1792 OnRenderAutoResized(new_size);
1791 } 1793 }
1792 1794
1793 } // namespace content 1795 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698