| OLD | NEW |
| 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 10 matching lines...) Expand all Loading... |
| 21 class Message; | 21 class Message; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace gfx { | 24 namespace gfx { |
| 25 class Range; | 25 class Range; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 | 29 |
| 30 class MessageLoopRunner; | 30 class MessageLoopRunner; |
| 31 class RenderFrameHost; |
| 31 class RenderProcessHost; | 32 class RenderProcessHost; |
| 32 class RenderWidgetHost; | 33 class RenderWidgetHost; |
| 33 class RenderWidgetHostView; | 34 class RenderWidgetHostView; |
| 34 class RenderWidgetHostViewBase; | 35 class RenderWidgetHostViewBase; |
| 35 class WebContents; | 36 class WebContents; |
| 36 struct TextInputState; | 37 struct TextInputState; |
| 37 | 38 |
| 38 // Returns the |TextInputState.type| from the TextInputManager owned by | 39 // Returns the |TextInputState.type| from the TextInputManager owned by |
| 39 // |web_contents|. | 40 // |web_contents|. |
| 40 ui::TextInputType GetTextInputTypeFromWebContents(WebContents* web_contents); | 41 ui::TextInputType GetTextInputTypeFromWebContents(WebContents* web_contents); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 54 // Returns the RWHV corresponding to the frame with a focused <input> within the | 55 // Returns the RWHV corresponding to the frame with a focused <input> within the |
| 55 // given WebContents. | 56 // given WebContents. |
| 56 RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents); | 57 RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents); |
| 57 | 58 |
| 58 // This method will send a request for an immediate update on composition range | 59 // This method will send a request for an immediate update on composition range |
| 59 // from TextInputManager's active widget corresponding to the |web_contents|. | 60 // from TextInputManager's active widget corresponding to the |web_contents|. |
| 60 // This function will return false if the request is not successfully sent; | 61 // This function will return false if the request is not successfully sent; |
| 61 // either due to missing TextInputManager or lack of an active widget. | 62 // either due to missing TextInputManager or lack of an active widget. |
| 62 bool RequestCompositionInfoFromActiveWidget(WebContents* web_contents); | 63 bool RequestCompositionInfoFromActiveWidget(WebContents* web_contents); |
| 63 | 64 |
| 65 // Returns true if |frame| has a focused editable element. |
| 66 bool DoesFrameHaveFocusedEditableElement(RenderFrameHost* frame); |
| 67 |
| 64 // This class provides the necessary API for accessing the state of and also | 68 // This class provides the necessary API for accessing the state of and also |
| 65 // observing the TextInputManager for WebContents. | 69 // observing the TextInputManager for WebContents. |
| 66 class TextInputManagerTester { | 70 class TextInputManagerTester { |
| 67 public: | 71 public: |
| 68 TextInputManagerTester(WebContents* web_contents); | 72 TextInputManagerTester(WebContents* web_contents); |
| 69 virtual ~TextInputManagerTester(); | 73 virtual ~TextInputManagerTester(); |
| 70 | 74 |
| 71 // Sets a callback which is invoked when a RWHV calls UpdateTextInputState | 75 // Sets a callback which is invoked when a RWHV calls UpdateTextInputState |
| 72 // on the TextInputManager which is being observed. | 76 // on the TextInputManager which is being observed. |
| 73 void SetUpdateTextInputStateCalledCallback(const base::Closure& callback); | 77 void SetUpdateTextInputStateCalledCallback(const base::Closure& callback); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 const gfx::Range& range); | 228 const gfx::Range& range); |
| 225 | 229 |
| 226 // Returns the total count of NSWindows instances which belong to the currently | 230 // Returns the total count of NSWindows instances which belong to the currently |
| 227 // running NSApplication. | 231 // running NSApplication. |
| 228 size_t GetOpenNSWindowsCount(); | 232 size_t GetOpenNSWindowsCount(); |
| 229 #endif | 233 #endif |
| 230 | 234 |
| 231 } // namespace content | 235 } // namespace content |
| 232 | 236 |
| 233 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ | 237 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ |
| OLD | NEW |