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

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

Issue 2208583005: Request to start/stop calculating composition info from RenderWidget when it is active/inactive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing a Crash due to Pure Virtual Call Created 4 years, 4 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 ui::TextInputType* type); 42 ui::TextInputType* type);
43 43
44 // This method returns the number of RenderWidgetHostViews which are currently 44 // This method returns the number of RenderWidgetHostViews which are currently
45 // registered with the TextInputManager that is owned by |web_contents|. 45 // registered with the TextInputManager that is owned by |web_contents|.
46 size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents); 46 size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents);
47 47
48 // Returns the RWHV corresponding to the frame with a focused <input> within the 48 // Returns the RWHV corresponding to the frame with a focused <input> within the
49 // given WebContents. 49 // given WebContents.
50 RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents); 50 RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents);
51 51
52 // This method will send an InputMsg_ImeSetComposition IPC with the provided 52 // This method will send a request for an immediate update on composition range
53 // parameters to the |render_widget_host|. 53 // from TextInputManager's active widget corresponding to the |web_contents|.
54 void SetCompositionForRenderWidgetHost( 54 // This function will return false if the request is not successfully sent;
55 RenderWidgetHost* render_widget_host, 55 // either due to missing TextInputManager or lack of an active widget.
56 const base::string16& text, 56 bool RequestCompositionInfoFromActiveWidget(WebContents* web_contents);
EhsanK 2016/08/03 22:07:29 This is a direct request to send composition info,
57 const std::vector<ui::CompositionUnderline>& underlines,
58 const gfx::Range& replacement_range,
59 int selection_start,
60 int selection_end);
61 57
62 // This class provides the necessary API for accessing the state of and also 58 // This class provides the necessary API for accessing the state of and also
63 // observing the TextInputManager for WebContents. 59 // observing the TextInputManager for WebContents.
64 class TextInputManagerTester { 60 class TextInputManagerTester {
65 public: 61 public:
66 TextInputManagerTester(WebContents* web_contents); 62 TextInputManagerTester(WebContents* web_contents);
67 virtual ~TextInputManagerTester(); 63 virtual ~TextInputManagerTester();
68 64
69 // Sets a callback which is invoked when a RWHV calls UpdateTextInputState 65 // Sets a callback which is invoked when a RWHV calls UpdateTextInputState
70 // on the TextInputManager which is being observed. 66 // on the TextInputManager which is being observed.
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 const base::Closure& callback) = 0; 176 const base::Closure& callback) = 0;
181 virtual void SetOnShowImeIfNeededCallback(const base::Closure& callback) = 0; 177 virtual void SetOnShowImeIfNeededCallback(const base::Closure& callback) = 0;
182 178
183 protected: 179 protected:
184 TestInputMethodObserver(); 180 TestInputMethodObserver();
185 }; 181 };
186 182
187 } // namespace content 183 } // namespace content
188 184
189 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ 185 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698