| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // This method will send an InputMsg_ImeSetComposition IPC with the provided | 52 // This method will send an InputMsg_ImeSetComposition IPC with the provided |
| 53 // parameters to the |render_widget_host|. | 53 // parameters to the |render_widget_host|. |
| 54 void SetCompositionForRenderWidgetHost( | 54 void SetCompositionForRenderWidgetHost( |
| 55 RenderWidgetHost* render_widget_host, | 55 RenderWidgetHost* render_widget_host, |
| 56 const base::string16& text, | 56 const base::string16& text, |
| 57 const std::vector<ui::CompositionUnderline>& underlines, | 57 const std::vector<ui::CompositionUnderline>& underlines, |
| 58 const gfx::Range& replacement_range, | 58 const gfx::Range& replacement_range, |
| 59 int selection_start, | 59 int selection_start, |
| 60 int selection_end); | 60 int selection_end); |
| 61 | 61 |
| 62 // This methods returns the current selection text for the |view|. |
| 63 base::string16 GetSelectedTextForRenderWidgetHostView( |
| 64 RenderWidgetHostView* view); |
| 65 |
| 62 // This class provides the necessary API for accessing the state of and also | 66 // This class provides the necessary API for accessing the state of and also |
| 63 // observing the TextInputManager for WebContents. | 67 // observing the TextInputManager for WebContents. |
| 64 class TextInputManagerTester { | 68 class TextInputManagerTester { |
| 65 public: | 69 public: |
| 66 TextInputManagerTester(WebContents* web_contents); | 70 TextInputManagerTester(WebContents* web_contents); |
| 67 virtual ~TextInputManagerTester(); | 71 virtual ~TextInputManagerTester(); |
| 68 | 72 |
| 69 // Sets a callback which is invoked when a RWHV calls UpdateTextInputState | 73 // Sets a callback which is invoked when a RWHV calls UpdateTextInputState |
| 70 // on the TextInputManager which is being observed. | 74 // on the TextInputManager which is being observed. |
| 71 void SetUpdateTextInputStateCalledCallback(const base::Closure& callback); | 75 void SetUpdateTextInputStateCalledCallback(const base::Closure& callback); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 const base::Closure& callback) = 0; | 176 const base::Closure& callback) = 0; |
| 173 virtual void SetOnShowImeIfNeededCallback(const base::Closure& callback) = 0; | 177 virtual void SetOnShowImeIfNeededCallback(const base::Closure& callback) = 0; |
| 174 | 178 |
| 175 protected: | 179 protected: |
| 176 TestInputMethodObserver(); | 180 TestInputMethodObserver(); |
| 177 }; | 181 }; |
| 178 | 182 |
| 179 } // namespace content | 183 } // namespace content |
| 180 | 184 |
| 181 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ | 185 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ |
| OLD | NEW |