1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_TEST_API_H_
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_TEST_API_H_
8 #include "ui/views/controls/textfield/textfield.h"
12 // Helper class to access internal state of Textfield in tests.
13 class TextfieldTestApi
{
15 explicit TextfieldTestApi(Textfield
* textfield
);
17 void UpdateContextMenu();
19 gfx::RenderText
* GetRenderText() const;
21 void CreateTouchSelectionControllerAndNotifyIt();
23 void ResetTouchSelectionController();
25 TextfieldModel
* model() const { return textfield_
->model_
.get(); }
27 ui::MenuModel
* context_menu_contents() const {
28 return textfield_
->context_menu_contents_
.get();
31 ui::TouchEditingControllerDeprecated
* touch_selection_controller() const {
32 return textfield_
->touch_selection_controller_
.get();
36 Textfield
* textfield_
;
38 DISALLOW_COPY_AND_ASSIGN(TextfieldTestApi
);
43 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_TEST_API_H_