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 <tuple> | 10 #include <tuple> |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 | 739 |
740 if (delegate_) | 740 if (delegate_) |
741 delegate_->LostCapture(this); | 741 delegate_->LostCapture(this); |
742 } | 742 } |
743 | 743 |
744 void RenderWidgetHostImpl::SetActive(bool active) { | 744 void RenderWidgetHostImpl::SetActive(bool active) { |
745 Send(new ViewMsg_SetActive(routing_id_, active)); | 745 Send(new ViewMsg_SetActive(routing_id_, active)); |
746 } | 746 } |
747 | 747 |
748 void RenderWidgetHostImpl::LostMouseLock() { | 748 void RenderWidgetHostImpl::LostMouseLock() { |
749 Send(new ViewMsg_MouseLockLost(routing_id_)); | |
750 | |
751 if (delegate_) | 749 if (delegate_) |
752 delegate_->LostMouseLock(this); | 750 delegate_->LostMouseLock(this); |
753 } | 751 } |
754 | 752 |
| 753 void RenderWidgetHostImpl::SendMouseLockLost() { |
| 754 Send(new ViewMsg_MouseLockLost(routing_id_)); |
| 755 } |
| 756 |
755 void RenderWidgetHostImpl::ViewDestroyed() { | 757 void RenderWidgetHostImpl::ViewDestroyed() { |
756 RejectMouseLockOrUnlockIfNecessary(); | 758 RejectMouseLockOrUnlockIfNecessary(); |
757 | 759 |
758 // TODO(evanm): tracking this may no longer be necessary; | 760 // TODO(evanm): tracking this may no longer be necessary; |
759 // eliminate this function if so. | 761 // eliminate this function if so. |
760 SetView(NULL); | 762 SetView(NULL); |
761 } | 763 } |
762 | 764 |
763 void RenderWidgetHostImpl::CopyFromBackingStore( | 765 void RenderWidgetHostImpl::CopyFromBackingStore( |
764 const gfx::Rect& src_subrect, | 766 const gfx::Rect& src_subrect, |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1770 view_->ImeCancelComposition(); | 1772 view_->ImeCancelComposition(); |
1771 } | 1773 } |
1772 | 1774 |
1773 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture, | 1775 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture, |
1774 bool last_unlocked_by_target, | 1776 bool last_unlocked_by_target, |
1775 bool privileged) { | 1777 bool privileged) { |
1776 if (pending_mouse_lock_request_) { | 1778 if (pending_mouse_lock_request_) { |
1777 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); | 1779 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); |
1778 return; | 1780 return; |
1779 } | 1781 } |
1780 if (IsMouseLocked()) { | |
1781 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); | |
1782 return; | |
1783 } | |
1784 | 1782 |
1785 pending_mouse_lock_request_ = true; | 1783 pending_mouse_lock_request_ = true; |
1786 if (privileged && allow_privileged_mouse_lock_) { | 1784 if (privileged && allow_privileged_mouse_lock_) { |
1787 // Directly approve to lock the mouse. | 1785 // Directly approve to lock the mouse. |
1788 GotResponseToLockMouseRequest(true); | 1786 GotResponseToLockMouseRequest(true); |
1789 } else { | 1787 } else { |
1790 if (delegate_) { | 1788 if (delegate_) { |
1791 delegate_->RequestToLockMouse(this, user_gesture, | 1789 delegate_->RequestToLockMouse(this, user_gesture, |
1792 last_unlocked_by_target); | 1790 last_unlocked_by_target); |
1793 return; | 1791 return; |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2204 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; | 2202 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; |
2205 } | 2203 } |
2206 | 2204 |
2207 BrowserAccessibilityManager* | 2205 BrowserAccessibilityManager* |
2208 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { | 2206 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { |
2209 return delegate_ ? | 2207 return delegate_ ? |
2210 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; | 2208 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; |
2211 } | 2209 } |
2212 | 2210 |
2213 } // namespace content | 2211 } // namespace content |
OLD | NEW |