| OLD | NEW |
| 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 Loading... |
| 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( |
| 1044 bool /* user_gesture */, |
| 1045 bool /* last_unlocked_by_target */) { |
| 1044 // Directly reject to lock the mouse. Subclass can override this method to | 1046 // Directly reject to lock the mouse. Subclass can override this method to |
| 1045 // decide whether to allow mouse lock or not. | 1047 // decide whether to allow mouse lock or not. |
| 1046 GotResponseToLockMouseRequest(false); | 1048 GotResponseToLockMouseRequest(false); |
| 1047 } | 1049 } |
| 1048 | 1050 |
| 1049 void RenderWidgetHostImpl::RejectMouseLockOrUnlockIfNecessary() { | 1051 void RenderWidgetHostImpl::RejectMouseLockOrUnlockIfNecessary() { |
| 1050 DCHECK(!pending_mouse_lock_request_ || !IsMouseLocked()); | 1052 DCHECK(!pending_mouse_lock_request_ || !IsMouseLocked()); |
| 1051 if (pending_mouse_lock_request_) { | 1053 if (pending_mouse_lock_request_) { |
| 1052 pending_mouse_lock_request_ = false; | 1054 pending_mouse_lock_request_ = false; |
| 1053 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); | 1055 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 void RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing( | 1480 void RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing( |
| 1479 bool activated) { | 1481 bool activated) { |
| 1480 TRACE_EVENT1("renderer_host", | 1482 TRACE_EVENT1("renderer_host", |
| 1481 "RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing", | 1483 "RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing", |
| 1482 "activated", activated); | 1484 "activated", activated); |
| 1483 is_accelerated_compositing_active_ = activated; | 1485 is_accelerated_compositing_active_ = activated; |
| 1484 if (view_) | 1486 if (view_) |
| 1485 view_->OnAcceleratedCompositingStateChange(); | 1487 view_->OnAcceleratedCompositingStateChange(); |
| 1486 } | 1488 } |
| 1487 | 1489 |
| 1488 void RenderWidgetHostImpl::OnMsgLockMouse(bool user_gesture) { | 1490 void RenderWidgetHostImpl::OnMsgLockMouse(bool user_gesture, |
| 1491 bool last_unlocked_by_target) { |
| 1492 |
| 1489 if (pending_mouse_lock_request_) { | 1493 if (pending_mouse_lock_request_) { |
| 1490 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); | 1494 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); |
| 1491 return; | 1495 return; |
| 1492 } else if (IsMouseLocked()) { | 1496 } else if (IsMouseLocked()) { |
| 1493 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); | 1497 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); |
| 1494 return; | 1498 return; |
| 1495 } | 1499 } |
| 1496 | 1500 |
| 1497 pending_mouse_lock_request_ = true; | 1501 pending_mouse_lock_request_ = true; |
| 1498 RequestToLockMouse(user_gesture); | 1502 RequestToLockMouse(user_gesture, last_unlocked_by_target); |
| 1499 } | 1503 } |
| 1500 | 1504 |
| 1501 void RenderWidgetHostImpl::OnMsgUnlockMouse() { | 1505 void RenderWidgetHostImpl::OnMsgUnlockMouse() { |
| 1502 RejectMouseLockOrUnlockIfNecessary(); | 1506 RejectMouseLockOrUnlockIfNecessary(); |
| 1503 } | 1507 } |
| 1504 | 1508 |
| 1505 #if defined(OS_POSIX) || defined(USE_AURA) | 1509 #if defined(OS_POSIX) || defined(USE_AURA) |
| 1506 void RenderWidgetHostImpl::OnMsgGetWindowRect(gfx::NativeViewId window_id, | 1510 void RenderWidgetHostImpl::OnMsgGetWindowRect(gfx::NativeViewId window_id, |
| 1507 gfx::Rect* results) { | 1511 gfx::Rect* results) { |
| 1508 if (view_) | 1512 if (view_) |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1784 // indicate that no callback is in progress (i.e. without this line | 1788 // indicate that no callback is in progress (i.e. without this line |
| 1785 // DelayedAutoResized will not get called again). | 1789 // DelayedAutoResized will not get called again). |
| 1786 new_auto_size_.SetSize(0, 0); | 1790 new_auto_size_.SetSize(0, 0); |
| 1787 if (!should_auto_resize_) | 1791 if (!should_auto_resize_) |
| 1788 return; | 1792 return; |
| 1789 | 1793 |
| 1790 OnRenderAutoResized(new_size); | 1794 OnRenderAutoResized(new_size); |
| 1791 } | 1795 } |
| 1792 | 1796 |
| 1793 } // namespace content | 1797 } // namespace content |
| OLD | NEW |