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

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

Issue 2054163003: Fix SitePerProcessTextInputManagerTest.StopTrackingCrashedChildFrame on CFI Bots. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing sky@'s comments 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 <unordered_map>
10 #include <vector>
11 9
12 #include "base/callback.h" 10 #include "base/callback.h"
13 #include "ui/base/ime/text_input_mode.h" 11 #include "ui/base/ime/text_input_mode.h"
14 #include "ui/base/ime/text_input_type.h" 12 #include "ui/base/ime/text_input_type.h"
15 13
16 namespace content { 14 namespace content {
17 15
18 class RenderWidgetHostView; 16 class RenderWidgetHostView;
19 class RenderWidgetHostViewBase; 17 class RenderWidgetHostViewBase;
20 class WebContents; 18 class WebContents;
21 struct TextInputState; 19 struct TextInputState;
22 20
23 // Returns the |TextInputState.type| from the TextInputManager owned by 21 // Returns the |TextInputState.type| from the TextInputManager owned by
24 // |web_contents|. 22 // |web_contents|.
25 ui::TextInputType GetTextInputTypeFromWebContents(WebContents* web_contents); 23 ui::TextInputType GetTextInputTypeFromWebContents(WebContents* web_contents);
26 24
27 // This method returns true if |view| is registered in the TextInputManager that 25 // This method returns true if |view| is registered in the TextInputManager that
28 // is owned by |web_contents|. If that is the case, the value of |type| will be 26 // is owned by |web_contents|. If that is the case, the value of |type| will be
29 // the |TextInputState.type| corresponding to the |view|. Returns false if 27 // the |TextInputState.type| corresponding to the |view|. Returns false if
30 // |view| is not registered. 28 // |view| is not registered.
31 bool GetTextInputTypeForView(WebContents* web_contents, 29 bool GetTextInputTypeForView(WebContents* web_contents,
32 RenderWidgetHostView* view, 30 RenderWidgetHostView* view,
33 ui::TextInputType* type); 31 ui::TextInputType* type);
34 32
33 // This method returns the number of RenderWidgetHostViews which are currently
34 // registered with the TextInputManager that is owned by |web_contents|.
35 size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents);
36
35 // Returns the RWHV corresponding to the frame with a focused <input> within the 37 // Returns the RWHV corresponding to the frame with a focused <input> within the
36 // given WebContents. 38 // given WebContents.
37 RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents); 39 RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents);
38 40
39 // This class provides the necessary API for accessing the state of and also 41 // This class provides the necessary API for accessing the state of and also
40 // observing the TextInputManager for WebContents. 42 // observing the TextInputManager for WebContents.
41 class TextInputManagerTester { 43 class TextInputManagerTester {
42 public: 44 public:
43 using Callback = base::Callback<void(TextInputManagerTester*)>; 45 using Callback = base::Callback<void(TextInputManagerTester*)>;
44 46
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 const base::Closure& callback) = 0; 146 const base::Closure& callback) = 0;
145 virtual void SetOnShowImeIfNeededCallback(const base::Closure& callback) = 0; 147 virtual void SetOnShowImeIfNeededCallback(const base::Closure& callback) = 0;
146 148
147 protected: 149 protected:
148 TestInputMethodObserver(); 150 TestInputMethodObserver();
149 }; 151 };
150 152
151 } // namespace content 153 } // namespace content
152 154
153 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ 155 #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