| 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 // TODO(ekaramad): GetSelectedText() is based on an outdated API which is now |
| 64 // removed. After implementing IME for OOPIF, change this to use a more updated |
| 65 // API from TextInputManager. |
| 66 base::string16 GetSelectedTextForRenderWidgetHostView( |
| 67 RenderWidgetHostView* view); |
| 68 |
| 62 // This class provides the necessary API for accessing the state of and also | 69 // This class provides the necessary API for accessing the state of and also |
| 63 // observing the TextInputManager for WebContents. | 70 // observing the TextInputManager for WebContents. |
| 64 class TextInputManagerTester { | 71 class TextInputManagerTester { |
| 65 public: | 72 public: |
| 66 TextInputManagerTester(WebContents* web_contents); | 73 TextInputManagerTester(WebContents* web_contents); |
| 67 virtual ~TextInputManagerTester(); | 74 virtual ~TextInputManagerTester(); |
| 68 | 75 |
| 69 // Sets a callback which is invoked when a RWHV calls UpdateTextInputState | 76 // Sets a callback which is invoked when a RWHV calls UpdateTextInputState |
| 70 // on the TextInputManager which is being observed. | 77 // on the TextInputManager which is being observed. |
| 71 void SetUpdateTextInputStateCalledCallback(const base::Closure& callback); | 78 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; | 179 const base::Closure& callback) = 0; |
| 173 virtual void SetOnShowImeIfNeededCallback(const base::Closure& callback) = 0; | 180 virtual void SetOnShowImeIfNeededCallback(const base::Closure& callback) = 0; |
| 174 | 181 |
| 175 protected: | 182 protected: |
| 176 TestInputMethodObserver(); | 183 TestInputMethodObserver(); |
| 177 }; | 184 }; |
| 178 | 185 |
| 179 } // namespace content | 186 } // namespace content |
| 180 | 187 |
| 181 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ | 188 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ |
| OLD | NEW |