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

Side by Side Diff: third_party/WebKit/Source/core/page/FocusController.h

Issue 2839993002: [Android] Adding Smart GO/NEXT feature in Chrome (Closed)
Patch Set: Rebased the patch along with review comment fixes. Created 3 years, 7 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 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 InputDeviceCapabilities* source_capabilities = nullptr) { 76 InputDeviceCapabilities* source_capabilities = nullptr) {
77 return AdvanceFocus(type, false, source_capabilities); 77 return AdvanceFocus(type, false, source_capabilities);
78 } 78 }
79 bool AdvanceFocusAcrossFrames( 79 bool AdvanceFocusAcrossFrames(
80 WebFocusType, 80 WebFocusType,
81 RemoteFrame* from, 81 RemoteFrame* from,
82 LocalFrame* to, 82 LocalFrame* to,
83 InputDeviceCapabilities* source_capabilities = nullptr); 83 InputDeviceCapabilities* source_capabilities = nullptr);
84 Element* FindFocusableElementInShadowHost(const Element& shadow_host); 84 Element* FindFocusableElementInShadowHost(const Element& shadow_host);
85 85
86 Element* FindFocusableElement(WebFocusType, Element&);
86 bool SetFocusedElement(Element*, Frame*, const FocusParams&); 87 bool SetFocusedElement(Element*, Frame*, const FocusParams&);
87 // |setFocusedElement| variant with SelectionBehaviorOnFocus::None, 88 // |setFocusedElement| variant with SelectionBehaviorOnFocus::None,
88 // |WebFocusTypeNone, and null InputDeviceCapabilities. 89 // |WebFocusTypeNone, and null InputDeviceCapabilities.
89 bool SetFocusedElement(Element*, Frame*); 90 bool SetFocusedElement(Element*, Frame*);
90 91
91 void SetActive(bool); 92 void SetActive(bool);
92 bool IsActive() const { return is_active_; } 93 bool IsActive() const { return is_active_; }
93 94
94 void SetFocused(bool); 95 void SetFocused(bool);
95 bool IsFocused() const { return is_focused_; } 96 bool IsFocused() const { return is_focused_; }
96 97
97 void RegisterFocusChangedObserver(FocusChangedObserver*); 98 void RegisterFocusChangedObserver(FocusChangedObserver*);
98 99
99 DECLARE_TRACE(); 100 DECLARE_TRACE();
100 101
101 private: 102 private:
102 explicit FocusController(Page*); 103 explicit FocusController(Page*);
103 104
104 Element* FindFocusableElement(WebFocusType, Element&);
105
106 bool AdvanceFocus(WebFocusType, 105 bool AdvanceFocus(WebFocusType,
107 bool initial_focus, 106 bool initial_focus,
108 InputDeviceCapabilities* source_capabilities = nullptr); 107 InputDeviceCapabilities* source_capabilities = nullptr);
109 bool AdvanceFocusDirectionally(WebFocusType); 108 bool AdvanceFocusDirectionally(WebFocusType);
110 bool AdvanceFocusInDocumentOrder( 109 bool AdvanceFocusInDocumentOrder(
111 LocalFrame*, 110 LocalFrame*,
112 Element* start, 111 Element* start,
113 WebFocusType, 112 WebFocusType,
114 bool initial_focus, 113 bool initial_focus,
115 InputDeviceCapabilities* source_capabilities); 114 InputDeviceCapabilities* source_capabilities);
(...skipping 12 matching lines...) Expand all
128 Member<Frame> focused_frame_; 127 Member<Frame> focused_frame_;
129 bool is_active_; 128 bool is_active_;
130 bool is_focused_; 129 bool is_focused_;
131 bool is_changing_focused_frame_; 130 bool is_changing_focused_frame_;
132 HeapHashSet<WeakMember<FocusChangedObserver>> focus_changed_observers_; 131 HeapHashSet<WeakMember<FocusChangedObserver>> focus_changed_observers_;
133 }; 132 };
134 133
135 } // namespace blink 134 } // namespace blink
136 135
137 #endif // FocusController_h 136 #endif // FocusController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698