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

Side by Side Diff: content/browser/web_contents/web_contents_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: Another test fix 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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 } 1578 }
1579 1579
1580 RenderWidgetHostInputEventRouter* WebContentsImpl::GetInputEventRouter() { 1580 RenderWidgetHostInputEventRouter* WebContentsImpl::GetInputEventRouter() {
1581 // Currently only supported in site per process mode (--site-per-process). 1581 // Currently only supported in site per process mode (--site-per-process).
1582 if (!rwh_input_event_router_.get() && !is_being_destroyed_ && 1582 if (!rwh_input_event_router_.get() && !is_being_destroyed_ &&
1583 SiteIsolationPolicy::AreCrossProcessFramesPossible()) 1583 SiteIsolationPolicy::AreCrossProcessFramesPossible())
1584 rwh_input_event_router_.reset(new RenderWidgetHostInputEventRouter); 1584 rwh_input_event_router_.reset(new RenderWidgetHostInputEventRouter);
1585 return rwh_input_event_router_.get(); 1585 return rwh_input_event_router_.get();
1586 } 1586 }
1587 1587
1588 void WebContentsImpl::SendFocusToCrossProcessRenderWidgets(bool is_focused) {
1589 // Focus loss may occur while this WebContents is being destroyed. Don't
1590 // send the message in this case, as the main frame's RenderFrameHost, which
1591 // is used when getting all RenderWidgetHostViews, has already been cleared.
1592 if (is_being_destroyed_)
alexmos 2015/10/09 20:23:29 For reference, the call stack leading to this is a
Charlie Reis 2015/10/09 21:21:51 Acknowledged.
1593 return;
1594
1595 for (RenderWidgetHostView* view : GetRenderWidgetHostViewsInTree()) {
1596 if (!view || view == GetRenderWidgetHostView())
Charlie Reis 2015/10/09 21:21:51 Hmm. It looks like any widget (including subframe
alexmos 2015/10/16 16:50:45 This is supposed to be only called from main widge
1597 continue;
1598
1599 RenderWidgetHostImpl* rwh =
1600 RenderWidgetHostImpl::From(view->GetRenderWidgetHost());
1601 rwh->Send(new InputMsg_SetFocus(rwh->GetRoutingID(), is_focused));
Charlie Reis 2015/10/09 21:21:51 As in the test, I'm wondering why we want to tell
alexmos 2015/10/16 16:50:45 I think we've cleared this up in earlier comments,
1602 }
1603 }
1604
1588 void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { 1605 void WebContentsImpl::EnterFullscreenMode(const GURL& origin) {
1589 // This method is being called to enter renderer-initiated fullscreen mode. 1606 // This method is being called to enter renderer-initiated fullscreen mode.
1590 // Make sure any existing fullscreen widget is shut down first. 1607 // Make sure any existing fullscreen widget is shut down first.
1591 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); 1608 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView();
1592 if (widget_view) 1609 if (widget_view)
1593 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); 1610 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown();
1594 1611
1595 if (delegate_) 1612 if (delegate_)
1596 delegate_->EnterFullscreenModeForTab(this, origin); 1613 delegate_->EnterFullscreenModeForTab(this, origin);
1597 1614
(...skipping 3041 matching lines...) Expand 10 before | Expand all | Expand 10 after
4639 return NULL; 4656 return NULL;
4640 } 4657 }
4641 4658
4642 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4659 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4643 force_disable_overscroll_content_ = force_disable; 4660 force_disable_overscroll_content_ = force_disable;
4644 if (view_) 4661 if (view_)
4645 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4662 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4646 } 4663 }
4647 4664
4648 } // namespace content 4665 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698