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

Side by Side Diff: content/browser/frame_host/cross_process_frame_connector.cc

Issue 1406103005: Preserve page-level focus for subframe cross-process navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@focus-page
Patch Set: Add comment Created 5 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/frame_host/cross_process_frame_connector.h" 5 #include "content/browser/frame_host/cross_process_frame_connector.h"
6 6
7 #include "cc/surfaces/surface.h" 7 #include "cc/surfaces/surface.h"
8 #include "cc/surfaces/surface_manager.h" 8 #include "cc/surfaces/surface_manager.h"
9 #include "content/browser/compositor/surface_utils.h" 9 #include "content/browser/compositor/surface_utils.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 if (rwhv) 163 if (rwhv)
164 static_cast<RenderWidgetHostViewBase*>(rwhv)->GetScreenInfo(results); 164 static_cast<RenderWidgetHostViewBase*>(rwhv)->GetScreenInfo(results);
165 } 165 }
166 166
167 void CrossProcessFrameConnector::UpdateCursor(const WebCursor& cursor) { 167 void CrossProcessFrameConnector::UpdateCursor(const WebCursor& cursor) {
168 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView(); 168 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView();
169 if (root_view) 169 if (root_view)
170 root_view->UpdateCursor(cursor); 170 root_view->UpdateCursor(cursor);
171 } 171 }
172 172
173 bool CrossProcessFrameConnector::HasFocus() {
174 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView();
175 if (root_view)
176 return root_view->HasFocus();
177 return false;
178 }
179
173 void CrossProcessFrameConnector::OnForwardInputEvent( 180 void CrossProcessFrameConnector::OnForwardInputEvent(
174 const blink::WebInputEvent* event) { 181 const blink::WebInputEvent* event) {
175 if (!view_) 182 if (!view_)
176 return; 183 return;
177 184
178 RenderFrameHostManager* manager = 185 RenderFrameHostManager* manager =
179 frame_proxy_in_parent_renderer_->frame_tree_node()->render_manager(); 186 frame_proxy_in_parent_renderer_->frame_tree_node()->render_manager();
180 RenderWidgetHostImpl* parent_widget = 187 RenderWidgetHostImpl* parent_widget =
181 manager->ForInnerDelegate() 188 manager->ForInnerDelegate()
182 ? manager->GetOuterRenderWidgetHostForKeyboardInput() 189 ? manager->GetOuterRenderWidgetHostForKeyboardInput()
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 CrossProcessFrameConnector::GetRootRenderWidgetHostView() { 236 CrossProcessFrameConnector::GetRootRenderWidgetHostView() {
230 return static_cast<RenderWidgetHostViewBase*>( 237 return static_cast<RenderWidgetHostViewBase*>(
231 frame_proxy_in_parent_renderer_->frame_tree_node() 238 frame_proxy_in_parent_renderer_->frame_tree_node()
232 ->frame_tree() 239 ->frame_tree()
233 ->root() 240 ->root()
234 ->current_frame_host() 241 ->current_frame_host()
235 ->GetView()); 242 ->GetView());
236 } 243 }
237 244
238 } // namespace content 245 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/cross_process_frame_connector.h ('k') | content/browser/frame_host/frame_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698