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

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

Issue 10173030: User Gesture plumbed from Renderer to Browser's FullscreenController::RequestToLockMouse. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: yzshen nits fixed. Created 8 years, 8 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
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 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 1001
1002 void RenderWidgetHostImpl::ImeCancelComposition() { 1002 void RenderWidgetHostImpl::ImeCancelComposition() {
1003 Send(new ViewMsg_ImeSetComposition(GetRoutingID(), string16(), 1003 Send(new ViewMsg_ImeSetComposition(GetRoutingID(), string16(),
1004 std::vector<WebKit::WebCompositionUnderline>(), 0, 0)); 1004 std::vector<WebKit::WebCompositionUnderline>(), 0, 0));
1005 } 1005 }
1006 1006
1007 gfx::Rect RenderWidgetHostImpl::GetRootWindowResizerRect() const { 1007 gfx::Rect RenderWidgetHostImpl::GetRootWindowResizerRect() const {
1008 return gfx::Rect(); 1008 return gfx::Rect();
1009 } 1009 }
1010 1010
1011 void RenderWidgetHostImpl::RequestToLockMouse() { 1011 void RenderWidgetHostImpl::RequestToLockMouse(bool /* user_gesture */) {
1012 // Directly reject to lock the mouse. Subclass can override this method to 1012 // Directly reject to lock the mouse. Subclass can override this method to
1013 // decide whether to allow mouse lock or not. 1013 // decide whether to allow mouse lock or not.
1014 GotResponseToLockMouseRequest(false); 1014 GotResponseToLockMouseRequest(false);
1015 } 1015 }
1016 1016
1017 void RenderWidgetHostImpl::RejectMouseLockOrUnlockIfNecessary() { 1017 void RenderWidgetHostImpl::RejectMouseLockOrUnlockIfNecessary() {
1018 DCHECK(!pending_mouse_lock_request_ || !IsMouseLocked()); 1018 DCHECK(!pending_mouse_lock_request_ || !IsMouseLocked());
1019 if (pending_mouse_lock_request_) { 1019 if (pending_mouse_lock_request_) {
1020 pending_mouse_lock_request_ = false; 1020 pending_mouse_lock_request_ = false;
1021 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); 1021 Send(new ViewMsg_LockMouse_ACK(routing_id_, false));
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 void RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing( 1420 void RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing(
1421 bool activated) { 1421 bool activated) {
1422 TRACE_EVENT1("renderer_host", 1422 TRACE_EVENT1("renderer_host",
1423 "RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing", 1423 "RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing",
1424 "activated", activated); 1424 "activated", activated);
1425 is_accelerated_compositing_active_ = activated; 1425 is_accelerated_compositing_active_ = activated;
1426 if (view_) 1426 if (view_)
1427 view_->OnAcceleratedCompositingStateChange(); 1427 view_->OnAcceleratedCompositingStateChange();
1428 } 1428 }
1429 1429
1430 void RenderWidgetHostImpl::OnMsgLockMouse() { 1430 void RenderWidgetHostImpl::OnMsgLockMouse(bool user_gesture) {
1431 if (pending_mouse_lock_request_) { 1431 if (pending_mouse_lock_request_) {
1432 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); 1432 Send(new ViewMsg_LockMouse_ACK(routing_id_, false));
1433 return; 1433 return;
1434 } else if (IsMouseLocked()) { 1434 } else if (IsMouseLocked()) {
1435 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); 1435 Send(new ViewMsg_LockMouse_ACK(routing_id_, true));
1436 return; 1436 return;
1437 } 1437 }
1438 1438
1439 pending_mouse_lock_request_ = true; 1439 pending_mouse_lock_request_ = true;
1440 RequestToLockMouse(); 1440 RequestToLockMouse(user_gesture);
1441 } 1441 }
1442 1442
1443 void RenderWidgetHostImpl::OnMsgUnlockMouse() { 1443 void RenderWidgetHostImpl::OnMsgUnlockMouse() {
1444 RejectMouseLockOrUnlockIfNecessary(); 1444 RejectMouseLockOrUnlockIfNecessary();
1445 } 1445 }
1446 1446
1447 #if defined(OS_POSIX) || defined(USE_AURA) 1447 #if defined(OS_POSIX) || defined(USE_AURA)
1448 void RenderWidgetHostImpl::OnMsgGetWindowRect(gfx::NativeViewId window_id, 1448 void RenderWidgetHostImpl::OnMsgGetWindowRect(gfx::NativeViewId window_id,
1449 gfx::Rect* results) { 1449 gfx::Rect* results) {
1450 if (view_) 1450 if (view_)
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 // indicate that no callback is in progress (i.e. without this line 1726 // indicate that no callback is in progress (i.e. without this line
1727 // DelayedAutoResized will not get called again). 1727 // DelayedAutoResized will not get called again).
1728 new_auto_size_.SetSize(0, 0); 1728 new_auto_size_.SetSize(0, 0);
1729 if (!should_auto_resize_) 1729 if (!should_auto_resize_)
1730 return; 1730 return;
1731 1731
1732 OnRenderAutoResized(new_size); 1732 OnRenderAutoResized(new_size);
1733 } 1733 }
1734 1734
1735 } // namespace content 1735 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698