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

Unified Diff: third_party/WebKit/Source/core/dom/Element.h

Issue 1420693006: Introduce a struct to store arguments of Element::focus(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Element.h
diff --git a/third_party/WebKit/Source/core/dom/Element.h b/third_party/WebKit/Source/core/dom/Element.h
index c39e834950f36d639ee7b3f60ca0437c9bb050e4..125207907bc33bab2ca45ae3acc2018d6326a70f 100644
--- a/third_party/WebKit/Source/core/dom/Element.h
+++ b/third_party/WebKit/Source/core/dom/Element.h
@@ -87,6 +87,25 @@ enum ElementFlags {
enum class ShadowRootType;
+enum class SelectionBehaviorOnFocus {
+ Reset,
+ Restore,
+};
+
+struct FocusParams {
+ STACK_ALLOCATED();
+
+ FocusParams() {}
+ FocusParams(SelectionBehaviorOnFocus selection, WebFocusType focusType, InputDeviceCapabilities* capabilities)
+ : selectionBehavior(selection)
+ , type(focusType)
+ , sourceCapabilities(capabilities) {}
+
+ SelectionBehaviorOnFocus selectionBehavior = SelectionBehaviorOnFocus::Restore;
+ WebFocusType type = WebFocusTypeNone;
+ Member<InputDeviceCapabilities> sourceCapabilities = nullptr;
+};
+
typedef WillBeHeapVector<RefPtrWillBeMember<Attr>> AttrNodeList;
class CORE_EXPORT Element : public ContainerNode {
@@ -371,8 +390,8 @@ public:
virtual const AtomicString imageSourceURL() const;
virtual Image* imageContents() { return nullptr; }
- virtual void focus(bool restorePreviousSelection = true, WebFocusType = WebFocusTypeNone, InputDeviceCapabilities* sourceCapabilities = nullptr);
- virtual void updateFocusAppearance(bool restorePreviousSelection);
+ virtual void focus(const FocusParams& = FocusParams());
+ virtual void updateFocusAppearance(SelectionBehaviorOnFocus);
virtual void blur();
void setDistributeScroll(ScrollStateCallback*, String nativeScrollBehavior);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698