Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: views/controls/textfield/native_textfield_views_unittest.cc

Issue 6881107: Rework the way Widget::Init works: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/tabbed_pane/native_tabbed_pane_win.cc ('k') | views/examples/widget_example.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « views/controls/tabbed_pane/native_tabbed_pane_win.cc ('k') | views/examples/widget_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698