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

Unified Diff: Source/core/page/FocusController.cpp

Issue 397023003: Preparing Blink for cross-process frame tree replication (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: dcheng comments addressed Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/rendering/compositing/RenderLayerCompositor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/FocusController.cpp
diff --git a/Source/core/page/FocusController.cpp b/Source/core/page/FocusController.cpp
index 2f3173962b8c6d642cf89752a69ac69d50b2852b..f25e5584c79181888c83b36bba4a1c3cff00205e 100644
--- a/Source/core/page/FocusController.cpp
+++ b/Source/core/page/FocusController.cpp
@@ -304,6 +304,14 @@ Frame* FocusController::focusedOrMainFrame() const
{
if (Frame* frame = focusedFrame())
return frame;
+
+ // FIXME: This is a temporary hack to ensure that we return a LocalFrame, even when the mainFrame is remote.
+ // FocusController needs to be refactored to deal with RemoteFrames cross-process focus transfers.
+ for (Frame* frame = m_page->mainFrame()->tree().top(); frame; frame = frame->tree().traverseNext()) {
+ if (frame->isLocalRoot())
+ return frame;
+ }
+
return m_page->mainFrame();
}
@@ -730,7 +738,9 @@ void FocusController::setActive(bool active)
view->updateControlTints();
}
- toLocalFrame(focusedOrMainFrame())->selection().pageActivationChanged();
+ Frame* frame = focusedOrMainFrame();
+ if (frame->isLocalFrame())
+ toLocalFrame(frame)->selection().pageActivationChanged();
}
static void updateFocusCandidateIfNeeded(FocusType type, const FocusCandidate& current, FocusCandidate& candidate, FocusCandidate& closest)
« no previous file with comments | « no previous file | Source/core/rendering/compositing/RenderLayerCompositor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698