| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/auto_reset.h" | 5 #include "base/auto_reset.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 void InitTextfield(Textfield::StyleFlags style) { | 149 void InitTextfield(Textfield::StyleFlags style) { |
| 150 InitTextfields(style, 1); | 150 InitTextfields(style, 1); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void InitTextfields(Textfield::StyleFlags style, int count) { | 153 void InitTextfields(Textfield::StyleFlags style, int count) { |
| 154 ASSERT_FALSE(textfield_); | 154 ASSERT_FALSE(textfield_); |
| 155 textfield_ = new TestTextfield(style); | 155 textfield_ = new TestTextfield(style); |
| 156 textfield_->SetController(this); | 156 textfield_->SetController(this); |
| 157 widget_ = Widget::CreateWidget(); |
| 157 Widget::CreateParams params(Widget::CreateParams::TYPE_POPUP); | 158 Widget::CreateParams params(Widget::CreateParams::TYPE_POPUP); |
| 158 params.mirror_origin_in_rtl = false; | 159 params.bounds = gfx::Rect(100, 100, 100, 100); |
| 159 widget_ = Widget::CreateWidget(params); | 160 widget_->Init(params); |
| 160 widget_->Init(NULL, gfx::Rect(100, 100, 100, 100)); | |
| 161 View* container = new View(); | 161 View* container = new View(); |
| 162 widget_->SetContentsView(container); | 162 widget_->SetContentsView(container); |
| 163 container->AddChildView(textfield_); | 163 container->AddChildView(textfield_); |
| 164 | 164 |
| 165 textfield_view_ | 165 textfield_view_ |
| 166 = static_cast<NativeTextfieldViews*>(textfield_->native_wrapper()); | 166 = static_cast<NativeTextfieldViews*>(textfield_->native_wrapper()); |
| 167 textfield_->SetID(1); | 167 textfield_->SetID(1); |
| 168 | 168 |
| 169 for (int i = 1; i < count; i++) { | 169 for (int i = 1; i < count; i++) { |
| 170 Textfield* textfield = new Textfield(style); | 170 Textfield* textfield = new Textfield(style); |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 | 706 |
| 707 textfield_->SetReadOnly(false); | 707 textfield_->SetReadOnly(false); |
| 708 input_method_->Clear(); | 708 input_method_->Clear(); |
| 709 textfield_->SetPassword(true); | 709 textfield_->SetPassword(true); |
| 710 EXPECT_TRUE(input_method_->text_input_type_changed()); | 710 EXPECT_TRUE(input_method_->text_input_type_changed()); |
| 711 EXPECT_TRUE(textfield_->GetTextInputClient()); | 711 EXPECT_TRUE(textfield_->GetTextInputClient()); |
| 712 } | 712 } |
| 713 | 713 |
| 714 | 714 |
| 715 } // namespace views | 715 } // namespace views |
| OLD | NEW |