| 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 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1724 | 1724 |
| 1725 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture, | 1725 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture, |
| 1726 bool last_unlocked_by_target, | 1726 bool last_unlocked_by_target, |
| 1727 bool privileged) { | 1727 bool privileged) { |
| 1728 if (pending_mouse_lock_request_) { | 1728 if (pending_mouse_lock_request_) { |
| 1729 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); | 1729 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); |
| 1730 return; | 1730 return; |
| 1731 } | 1731 } |
| 1732 | 1732 |
| 1733 pending_mouse_lock_request_ = true; | 1733 pending_mouse_lock_request_ = true; |
| 1734 if (delegate_) { |
| 1735 delegate_->RequestToLockMouse(this, user_gesture, last_unlocked_by_target, |
| 1736 privileged && allow_privileged_mouse_lock_); |
| 1737 return; |
| 1738 } |
| 1739 |
| 1734 if (privileged && allow_privileged_mouse_lock_) { | 1740 if (privileged && allow_privileged_mouse_lock_) { |
| 1735 // Directly approve to lock the mouse. | 1741 // Directly approve to lock the mouse. |
| 1736 GotResponseToLockMouseRequest(true); | 1742 GotResponseToLockMouseRequest(true); |
| 1737 } else { | 1743 } else { |
| 1738 if (delegate_) { | 1744 // Otherwise, just reject it. |
| 1739 delegate_->RequestToLockMouse(this, user_gesture, | |
| 1740 last_unlocked_by_target); | |
| 1741 return; | |
| 1742 } | |
| 1743 // If there's no delegate, just reject it. | |
| 1744 GotResponseToLockMouseRequest(false); | 1745 GotResponseToLockMouseRequest(false); |
| 1745 } | 1746 } |
| 1746 } | 1747 } |
| 1747 | 1748 |
| 1748 void RenderWidgetHostImpl::OnUnlockMouse() { | 1749 void RenderWidgetHostImpl::OnUnlockMouse() { |
| 1749 RejectMouseLockOrUnlockIfNecessary(); | 1750 RejectMouseLockOrUnlockIfNecessary(); |
| 1750 } | 1751 } |
| 1751 | 1752 |
| 1752 void RenderWidgetHostImpl::OnShowDisambiguationPopup( | 1753 void RenderWidgetHostImpl::OnShowDisambiguationPopup( |
| 1753 const gfx::Rect& rect_pixels, | 1754 const gfx::Rect& rect_pixels, |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2152 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; | 2153 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; |
| 2153 } | 2154 } |
| 2154 | 2155 |
| 2155 BrowserAccessibilityManager* | 2156 BrowserAccessibilityManager* |
| 2156 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { | 2157 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { |
| 2157 return delegate_ ? | 2158 return delegate_ ? |
| 2158 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; | 2159 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; |
| 2159 } | 2160 } |
| 2160 | 2161 |
| 2161 } // namespace content | 2162 } // namespace content |
| OLD | NEW |