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

Side by Side Diff: content/public/test/text_input_test_utils.h

Issue 2130133004: Tracking text selection on the browser side in OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize/Clear TextSelection for each view + make GetTextSelection() const. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ 5 #ifndef CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_
6 #define CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ 6 #define CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 void SetUpdateTextInputStateCalledCallback(const base::Closure& callback); 71 void SetUpdateTextInputStateCalledCallback(const base::Closure& callback);
72 72
73 // Sets a callback which is invoked when a RWHV calls SelectionBoundsChanged 73 // Sets a callback which is invoked when a RWHV calls SelectionBoundsChanged
74 // on the TextInputManager which is being observed. 74 // on the TextInputManager which is being observed.
75 void SetOnSelectionBoundsChangedCallback(const base::Closure& callback); 75 void SetOnSelectionBoundsChangedCallback(const base::Closure& callback);
76 76
77 // Sets a callback which is invoked when a RWHV calls 77 // Sets a callback which is invoked when a RWHV calls
78 // ImeCompositionRangeChanged on the TextInputManager that is being observed. 78 // ImeCompositionRangeChanged on the TextInputManager that is being observed.
79 void SetOnImeCompositionRangeChangedCallback(const base::Closure& callback); 79 void SetOnImeCompositionRangeChangedCallback(const base::Closure& callback);
80 80
81 // Sets a callback which is invoked when a RWHV calls SelectionChanged on the
82 // TextInputManager which is being observed.
83 void SetOnTextSelectionChangedCallback(const base::Closure& callback);
84
81 // Returns true if there is a focused <input> and populates |type| with 85 // Returns true if there is a focused <input> and populates |type| with
82 // |TextInputState.type| of the TextInputManager. 86 // |TextInputState.type| of the TextInputManager.
83 bool GetTextInputType(ui::TextInputType* type); 87 bool GetTextInputType(ui::TextInputType* type);
84 88
85 // Returns true if there is a focused <input> and populates |value| with 89 // Returns true if there is a focused <input> and populates |value| with
86 // |TextInputState.value| of the TextInputManager. 90 // |TextInputState.value| of the TextInputManager.
87 bool GetTextInputValue(std::string* value); 91 bool GetTextInputValue(std::string* value);
88 92
93 // Returns true if there is a focused <input> and populates |length| with the
94 // length of the selected text range in the focused view.
95 bool GetCurrentTextSelectionLength(size_t* length);
96
89 // Returns the RenderWidgetHostView with a focused <input> element or nullptr 97 // Returns the RenderWidgetHostView with a focused <input> element or nullptr
90 // if none exists. 98 // if none exists.
91 const RenderWidgetHostView* GetActiveView(); 99 const RenderWidgetHostView* GetActiveView();
92 100
93 // Returns the RenderWidgetHostView which has most recently updated any of its 101 // Returns the RenderWidgetHostView which has most recently updated any of its
94 // state (e.g., TextInputState or otherwise). 102 // state (e.g., TextInputState or otherwise).
95 const RenderWidgetHostView* GetUpdatedView(); 103 const RenderWidgetHostView* GetUpdatedView();
96 104
97 // Returns true if a call to TextInputManager::UpdateTextInputState has led 105 // Returns true if a call to TextInputManager::UpdateTextInputState has led
98 // to a change in TextInputState (since the time the observer has been 106 // to a change in TextInputState (since the time the observer has been
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 const base::Closure& callback) = 0; 180 const base::Closure& callback) = 0;
173 virtual void SetOnShowImeIfNeededCallback(const base::Closure& callback) = 0; 181 virtual void SetOnShowImeIfNeededCallback(const base::Closure& callback) = 0;
174 182
175 protected: 183 protected:
176 TestInputMethodObserver(); 184 TestInputMethodObserver();
177 }; 185 };
178 186
179 } // namespace content 187 } // namespace content
180 188
181 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ 189 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/text_input_manager.cc ('k') | content/public/test/text_input_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698