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