Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ui / views / controls / textfield / textfield_test_api.h
blob1af2ffcdf62c5e207869c9b067489b77c35ddbe8
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"
10 namespace views {
12 // Helper class to access internal state of Textfield in tests.
13 class TextfieldTestApi {
14 public:
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::TouchSelectionController* touch_selection_controller() const {
32 return textfield_->touch_selection_controller_.get();
35 private:
36 Textfield* textfield_;
38 DISALLOW_COPY_AND_ASSIGN(TextfieldTestApi);
41 } // namespace views
43 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_TEST_API_H_