Chromium Code Reviews| 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 <unordered_map> | 9 #include <unordered_map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 public: | 42 public: |
| 43 using Callback = base::Callback<void(TextInputManagerTester*)>; | 43 using Callback = base::Callback<void(TextInputManagerTester*)>; |
| 44 | 44 |
| 45 TextInputManagerTester(WebContents* web_contents); | 45 TextInputManagerTester(WebContents* web_contents); |
| 46 virtual ~TextInputManagerTester(); | 46 virtual ~TextInputManagerTester(); |
| 47 | 47 |
| 48 // Sets a callback which is invoked when a RWHV calls UpdateTextInputState | 48 // Sets a callback which is invoked when a RWHV calls UpdateTextInputState |
| 49 // on the TextInputManager which is being observed. | 49 // on the TextInputManager which is being observed. |
| 50 void SetUpdateTextInputStateCalledCallback(const Callback& callback); | 50 void SetUpdateTextInputStateCalledCallback(const Callback& callback); |
| 51 | 51 |
| 52 // Sets a callback which is invoked when a RWHV calls SelectionBoundsChanged | |
| 53 // on the TextInputManager which is being observed. | |
| 54 void SetOnSelectionBoundsChangedCallback(const Callback& callback); | |
| 55 | |
| 52 // Returns true if there is a focused <input> and populates |type| with | 56 // Returns true if there is a focused <input> and populates |type| with |
| 53 // |TextInputState.type| of the TextInputManager. | 57 // |TextInputState.type| of the TextInputManager. |
| 54 bool GetTextInputType(ui::TextInputType* type); | 58 bool GetTextInputType(ui::TextInputType* type); |
| 55 | 59 |
| 56 // Returns true if there is a focused <input> and populates |value| with | 60 // Returns true if there is a focused <input> and populates |value| with |
| 57 // |TextInputState.value| of the TextInputManager. | 61 // |TextInputState.value| of the TextInputManager. |
| 58 bool GetTextInputValue(std::string* value); | 62 bool GetTextInputValue(std::string* value); |
| 59 | 63 |
| 60 // Returns the RenderWidgetHostView with a focused <input> element or nullptr | 64 // Returns the RenderWidgetHostView with a focused <input> element or nullptr |
| 61 // if none exists. | 65 // if none exists. |
| 62 const RenderWidgetHostView* GetActiveView(); | 66 const RenderWidgetHostView* GetActiveView(); |
| 63 | 67 |
| 64 // Returns the RenderWidgetHostView which has most recently called | 68 // Returns the RenderWidgetHostView which has most recently updated its state, |
| 65 // TextInputManager::UpdateTextInputState on the TextInputManager which is | 69 // i.e., selection bonuds or TextInputState, with the TextInputManager that is |
|
kenrb
2016/06/28 19:15:23
nit: typo 'bonuds'
EhsanK
2016/06/29 17:09:58
Done.
| |
| 66 // being observed. | 70 // being observed. |
| 67 const RenderWidgetHostView* GetUpdatedView(); | 71 const RenderWidgetHostView* GetUpdatedView(); |
| 68 | 72 |
| 69 // Returns true if a call to TextInputManager::UpdateTextInputState has led | 73 // Returns true if a call to TextInputManager::UpdateTextInputState has led |
| 70 // to a change in TextInputState (since the time the observer has been | 74 // to a change in TextInputState (since the time the observer has been |
| 71 // created). | 75 // created). |
| 72 bool IsTextInputStateChanged(); | 76 bool IsTextInputStateChanged(); |
| 73 | 77 |
| 74 private: | 78 private: |
| 75 // The actual internal observer of the TextInputManager. | 79 // The actual internal observer of the TextInputManager. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 const base::Closure& callback) = 0; | 148 const base::Closure& callback) = 0; |
| 145 virtual void SetOnShowImeIfNeededCallback(const base::Closure& callback) = 0; | 149 virtual void SetOnShowImeIfNeededCallback(const base::Closure& callback) = 0; |
| 146 | 150 |
| 147 protected: | 151 protected: |
| 148 TestInputMethodObserver(); | 152 TestInputMethodObserver(); |
| 149 }; | 153 }; |
| 150 | 154 |
| 151 } // namespace content | 155 } // namespace content |
| 152 | 156 |
| 153 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ | 157 #endif // CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_ |
| OLD | NEW |