| 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 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 void RenderWidgetHostImpl::GotFocus() { | 697 void RenderWidgetHostImpl::GotFocus() { |
| 698 Focus(); | 698 Focus(); |
| 699 if (delegate_) | 699 if (delegate_) |
| 700 delegate_->RenderWidgetGotFocus(this); | 700 delegate_->RenderWidgetGotFocus(this); |
| 701 } | 701 } |
| 702 | 702 |
| 703 void RenderWidgetHostImpl::Focus() { | 703 void RenderWidgetHostImpl::Focus() { |
| 704 is_focused_ = true; | 704 is_focused_ = true; |
| 705 | 705 |
| 706 Send(new InputMsg_SetFocus(routing_id_, true)); | 706 Send(new InputMsg_SetFocus(routing_id_, true)); |
| 707 |
| 708 // Also send page-level focus state to other SiteInstances involved in |
| 709 // rendering the current FrameTree. |
| 710 if (IsRenderView() && delegate_) |
| 711 delegate_->ReplicatePageFocus(true); |
| 707 } | 712 } |
| 708 | 713 |
| 709 void RenderWidgetHostImpl::Blur() { | 714 void RenderWidgetHostImpl::Blur() { |
| 710 is_focused_ = false; | 715 is_focused_ = false; |
| 711 | 716 |
| 712 // If there is a pending mouse lock request, we don't want to reject it at | 717 // If there is a pending mouse lock request, we don't want to reject it at |
| 713 // this point. The user can switch focus back to this view and approve the | 718 // this point. The user can switch focus back to this view and approve the |
| 714 // request later. | 719 // request later. |
| 715 if (IsMouseLocked()) | 720 if (IsMouseLocked()) |
| 716 view_->UnlockMouse(); | 721 view_->UnlockMouse(); |
| 717 | 722 |
| 718 if (touch_emulator_) | 723 if (touch_emulator_) |
| 719 touch_emulator_->CancelTouch(); | 724 touch_emulator_->CancelTouch(); |
| 720 | 725 |
| 721 Send(new InputMsg_SetFocus(routing_id_, false)); | 726 Send(new InputMsg_SetFocus(routing_id_, false)); |
| 727 |
| 728 // Also send page-level focus state to other SiteInstances involved in |
| 729 // rendering the current FrameTree. |
| 730 if (IsRenderView() && delegate_) |
| 731 delegate_->ReplicatePageFocus(false); |
| 722 } | 732 } |
| 723 | 733 |
| 724 void RenderWidgetHostImpl::LostCapture() { | 734 void RenderWidgetHostImpl::LostCapture() { |
| 725 if (touch_emulator_) | 735 if (touch_emulator_) |
| 726 touch_emulator_->CancelTouch(); | 736 touch_emulator_->CancelTouch(); |
| 727 | 737 |
| 728 Send(new InputMsg_MouseCaptureLost(routing_id_)); | 738 Send(new InputMsg_MouseCaptureLost(routing_id_)); |
| 729 } | 739 } |
| 730 | 740 |
| 731 void RenderWidgetHostImpl::SetActive(bool active) { | 741 void RenderWidgetHostImpl::SetActive(bool active) { |
| (...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2190 } | 2200 } |
| 2191 | 2201 |
| 2192 #if defined(OS_WIN) | 2202 #if defined(OS_WIN) |
| 2193 gfx::NativeViewAccessible | 2203 gfx::NativeViewAccessible |
| 2194 RenderWidgetHostImpl::GetParentNativeViewAccessible() { | 2204 RenderWidgetHostImpl::GetParentNativeViewAccessible() { |
| 2195 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; | 2205 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; |
| 2196 } | 2206 } |
| 2197 #endif | 2207 #endif |
| 2198 | 2208 |
| 2199 } // namespace content | 2209 } // namespace content |
| OLD | NEW |