Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 1394383002: OOPIF: Send page-level focus messages to all processes rendering a page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 void RenderWidgetHostImpl::GotFocus() { 701 void RenderWidgetHostImpl::GotFocus() {
702 Focus(); 702 Focus();
703 if (delegate_) 703 if (delegate_)
704 delegate_->RenderWidgetGotFocus(this); 704 delegate_->RenderWidgetGotFocus(this);
705 } 705 }
706 706
707 void RenderWidgetHostImpl::Focus() { 707 void RenderWidgetHostImpl::Focus() {
708 is_focused_ = true; 708 is_focused_ = true;
709 709
710 Send(new InputMsg_SetFocus(routing_id_, true)); 710 Send(new InputMsg_SetFocus(routing_id_, true));
711
712 // Also send page-level focus state to other SiteInstances involved in
713 // rendering the current FrameTree.
714 if (IsRenderView() && delegate_)
Charlie Reis 2015/10/16 18:56:09 Does this still work with Avi's changes to split R
alexmos 2015/10/16 22:56:06 Yes, just confirmed that it does. RVHI is still a
715 delegate_->ReplicatePageFocus(true);
711 } 716 }
712 717
713 void RenderWidgetHostImpl::Blur() { 718 void RenderWidgetHostImpl::Blur() {
714 is_focused_ = false; 719 is_focused_ = false;
715 720
716 // If there is a pending mouse lock request, we don't want to reject it at 721 // If there is a pending mouse lock request, we don't want to reject it at
717 // this point. The user can switch focus back to this view and approve the 722 // this point. The user can switch focus back to this view and approve the
718 // request later. 723 // request later.
719 if (IsMouseLocked()) 724 if (IsMouseLocked())
720 view_->UnlockMouse(); 725 view_->UnlockMouse();
721 726
722 if (touch_emulator_) 727 if (touch_emulator_)
723 touch_emulator_->CancelTouch(); 728 touch_emulator_->CancelTouch();
724 729
725 Send(new InputMsg_SetFocus(routing_id_, false)); 730 Send(new InputMsg_SetFocus(routing_id_, false));
731
732 // Also send page-level focus state to other SiteInstances involved in
733 // rendering the current FrameTree.
734 if (IsRenderView() && delegate_)
735 delegate_->ReplicatePageFocus(false);
726 } 736 }
727 737
728 void RenderWidgetHostImpl::LostCapture() { 738 void RenderWidgetHostImpl::LostCapture() {
729 if (touch_emulator_) 739 if (touch_emulator_)
730 touch_emulator_->CancelTouch(); 740 touch_emulator_->CancelTouch();
731 741
732 Send(new InputMsg_MouseCaptureLost(routing_id_)); 742 Send(new InputMsg_MouseCaptureLost(routing_id_));
733 } 743 }
734 744
735 void RenderWidgetHostImpl::SetActive(bool active) { 745 void RenderWidgetHostImpl::SetActive(bool active) {
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
2193 } 2203 }
2194 2204
2195 #if defined(OS_WIN) 2205 #if defined(OS_WIN)
2196 gfx::NativeViewAccessible 2206 gfx::NativeViewAccessible
2197 RenderWidgetHostImpl::GetParentNativeViewAccessible() { 2207 RenderWidgetHostImpl::GetParentNativeViewAccessible() {
2198 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; 2208 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL;
2199 } 2209 }
2200 #endif 2210 #endif
2201 2211
2202 } // namespace content 2212 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698