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

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

Issue 939603002: Adding support for Smart GO NEXT feature in Android Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed the review comments and reused FocusController function for Navigation. Created 5 years, 8 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 | « Source/core/page/FocusController.h ('k') | Source/web/WebViewImpl.h » ('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 47a87e5e5f44ade3ccdab310f586841a9309280d..b8410616dd207af3960c32415917360f007446f8 100644
--- a/Source/core/page/FocusController.cpp
+++ b/Source/core/page/FocusController.cpp
@@ -70,6 +70,7 @@ static inline bool isShadowInsertionPointFocusScopeOwner(Node& node)
class FocusNavigationScope {
STACK_ALLOCATED();
public:
+ explicit FocusNavigationScope(TreeScope*);
Node* rootNode() const;
Element* owner() const;
static FocusNavigationScope focusNavigationScopeOf(const Node&);
@@ -79,7 +80,6 @@ public:
static FocusNavigationScope ownedByIFrame(const HTMLFrameOwnerElement&);
private:
- explicit FocusNavigationScope(TreeScope*);
RawPtrWillBeMember<TreeScope> m_rootTreeScope;
};
@@ -719,6 +719,12 @@ Node* FocusController::findFocusableNode(WebFocusType type, Node& node)
return findFocusableNodeAcrossFocusScopes(type, FocusNavigationScope::focusNavigationScopeOf(node), &node);
}
+Node* FocusController::findFocusableNode(WebFocusType type, Node* stayWithin, Node& node)
kochi 2015/04/09 05:44:38 Do you want to scope the search of prev/next focus
AKV 2015/04/09 06:16:21 haveNextInput()wanted check the returned value (a
kochi 2015/04/10 02:33:50 Are you confused with "frame" and "form" or am I?
AKV 2015/04/10 06:19:12 SMART GO should go within form1. Main goal of this
kochi 2015/04/10 06:26:20 Yes, this is what I meant in the original reply. S
+{
+ ASSERT(type == WebFocusTypeForward || type == WebFocusTypeBackward);
+ return findFocusableNodeAcrossFocusScopes(type, FocusNavigationScope(&stayWithin->treeScope()), &node);
+}
+
Node* FocusController::findFocusableNode(WebFocusType type, const FocusNavigationScope& scope, Node* node)
{
return type == WebFocusTypeForward ? nextFocusableNode(scope, node) : previousFocusableNode(scope, node);
« no previous file with comments | « Source/core/page/FocusController.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698