OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |