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

Side by Side Diff: ui/views/view_unittest.cc

Issue 138363004: Views Textfield fixes and cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync and rebase. Created 6 years, 11 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 | « ui/views/examples/textfield_example.cc ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <map> 5 #include <map>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 1548
1549 Widget* widget = new Widget; 1549 Widget* widget = new Widget;
1550 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP); 1550 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP);
1551 params.bounds = gfx::Rect(0, 0, 100, 100); 1551 params.bounds = gfx::Rect(0, 0, 100, 100);
1552 widget->Init(params); 1552 widget->Init(params);
1553 View* root_view = widget->GetRootView(); 1553 View* root_view = widget->GetRootView();
1554 1554
1555 Textfield* normal = new Textfield(); 1555 Textfield* normal = new Textfield();
1556 Textfield* read_only = new Textfield(); 1556 Textfield* read_only = new Textfield();
1557 read_only->SetReadOnly(true); 1557 read_only->SetReadOnly(true);
1558 Textfield* password = new Textfield(Textfield::STYLE_OBSCURED); 1558 Textfield* password = new Textfield();
1559 password->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD);
1559 1560
1560 root_view->AddChildView(normal); 1561 root_view->AddChildView(normal);
1561 root_view->AddChildView(read_only); 1562 root_view->AddChildView(read_only);
1562 root_view->AddChildView(password); 1563 root_view->AddChildView(password);
1563 1564
1564 normal->SetText(kNormalText); 1565 normal->SetText(kNormalText);
1565 read_only->SetText(kReadOnlyText); 1566 read_only->SetText(kReadOnlyText);
1566 password->SetText(kPasswordText); 1567 password->SetText(kPasswordText);
1567 1568
1568 // 1569 //
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after
3584 TestView view; 3585 TestView view;
3585 view.SetFocusable(true); 3586 view.SetFocusable(true);
3586 EXPECT_TRUE(view.focusable()); 3587 EXPECT_TRUE(view.focusable());
3587 view.SetEnabled(false); 3588 view.SetEnabled(false);
3588 EXPECT_TRUE(view.focusable()); 3589 EXPECT_TRUE(view.focusable());
3589 view.SetFocusable(false); 3590 view.SetFocusable(false);
3590 EXPECT_FALSE(view.focusable()); 3591 EXPECT_FALSE(view.focusable());
3591 } 3592 }
3592 3593
3593 } // namespace views 3594 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/textfield_example.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698