| 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 <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 | 736 |
| 737 if (delegate_) | 737 if (delegate_) |
| 738 delegate_->LostCapture(this); | 738 delegate_->LostCapture(this); |
| 739 } | 739 } |
| 740 | 740 |
| 741 void RenderWidgetHostImpl::SetActive(bool active) { | 741 void RenderWidgetHostImpl::SetActive(bool active) { |
| 742 Send(new ViewMsg_SetActive(routing_id_, active)); | 742 Send(new ViewMsg_SetActive(routing_id_, active)); |
| 743 } | 743 } |
| 744 | 744 |
| 745 void RenderWidgetHostImpl::LostMouseLock() { | 745 void RenderWidgetHostImpl::LostMouseLock() { |
| 746 Send(new ViewMsg_MouseLockLost(routing_id_)); | |
| 747 | |
| 748 if (delegate_) | 746 if (delegate_) |
| 749 delegate_->LostMouseLock(this); | 747 delegate_->LostMouseLock(this); |
| 750 } | 748 } |
| 751 | 749 |
| 750 void RenderWidgetHostImpl::SendMouseLockLost() { |
| 751 Send(new ViewMsg_MouseLockLost(routing_id_)); |
| 752 } |
| 753 |
| 752 void RenderWidgetHostImpl::ViewDestroyed() { | 754 void RenderWidgetHostImpl::ViewDestroyed() { |
| 753 RejectMouseLockOrUnlockIfNecessary(); | 755 RejectMouseLockOrUnlockIfNecessary(); |
| 754 | 756 |
| 755 // TODO(evanm): tracking this may no longer be necessary; | 757 // TODO(evanm): tracking this may no longer be necessary; |
| 756 // eliminate this function if so. | 758 // eliminate this function if so. |
| 757 SetView(NULL); | 759 SetView(NULL); |
| 758 } | 760 } |
| 759 | 761 |
| 760 void RenderWidgetHostImpl::CopyFromBackingStore( | 762 void RenderWidgetHostImpl::CopyFromBackingStore( |
| 761 const gfx::Rect& src_subrect, | 763 const gfx::Rect& src_subrect, |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 view_->ImeCancelComposition(); | 1734 view_->ImeCancelComposition(); |
| 1733 } | 1735 } |
| 1734 | 1736 |
| 1735 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture, | 1737 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture, |
| 1736 bool last_unlocked_by_target, | 1738 bool last_unlocked_by_target, |
| 1737 bool privileged) { | 1739 bool privileged) { |
| 1738 if (pending_mouse_lock_request_) { | 1740 if (pending_mouse_lock_request_) { |
| 1739 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); | 1741 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); |
| 1740 return; | 1742 return; |
| 1741 } | 1743 } |
| 1742 if (IsMouseLocked()) { | |
| 1743 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); | |
| 1744 return; | |
| 1745 } | |
| 1746 | 1744 |
| 1747 pending_mouse_lock_request_ = true; | 1745 pending_mouse_lock_request_ = true; |
| 1748 if (privileged && allow_privileged_mouse_lock_) { | 1746 if (privileged && allow_privileged_mouse_lock_) { |
| 1749 // Directly approve to lock the mouse. | 1747 // Directly approve to lock the mouse. |
| 1750 GotResponseToLockMouseRequest(true); | 1748 GotResponseToLockMouseRequest(true); |
| 1751 } else { | 1749 } else { |
| 1752 if (delegate_) { | 1750 if (delegate_) { |
| 1753 delegate_->RequestToLockMouse(this, user_gesture, | 1751 delegate_->RequestToLockMouse(this, user_gesture, |
| 1754 last_unlocked_by_target); | 1752 last_unlocked_by_target); |
| 1755 return; | 1753 return; |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2152 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; | 2150 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; |
| 2153 } | 2151 } |
| 2154 | 2152 |
| 2155 BrowserAccessibilityManager* | 2153 BrowserAccessibilityManager* |
| 2156 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { | 2154 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { |
| 2157 return delegate_ ? | 2155 return delegate_ ? |
| 2158 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; | 2156 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; |
| 2159 } | 2157 } |
| 2160 | 2158 |
| 2161 } // namespace content | 2159 } // namespace content |
| OLD | NEW |