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

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

Issue 8748001: Make text input type and password visibility bit independent in Textfield (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Textfield(STYLE_OBSCURED) sets TEXT_INPUT_TYPE_PASSWORD Created 9 years 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
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 <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/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 859
860 Widget* widget = new Widget; 860 Widget* widget = new Widget;
861 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); 861 Widget::InitParams params(Widget::InitParams::TYPE_POPUP);
862 params.bounds = gfx::Rect(0, 0, 100, 100); 862 params.bounds = gfx::Rect(0, 0, 100, 100);
863 widget->Init(params); 863 widget->Init(params);
864 View* root_view = widget->GetRootView(); 864 View* root_view = widget->GetRootView();
865 865
866 Textfield* normal = new Textfield(); 866 Textfield* normal = new Textfield();
867 Textfield* read_only = new Textfield(); 867 Textfield* read_only = new Textfield();
868 read_only->SetReadOnly(true); 868 read_only->SetReadOnly(true);
869 Textfield* password = new Textfield(Textfield::STYLE_PASSWORD); 869 Textfield* password = new Textfield(Textfield::STYLE_OBSCURED);
870 870
871 root_view->AddChildView(normal); 871 root_view->AddChildView(normal);
872 root_view->AddChildView(read_only); 872 root_view->AddChildView(read_only);
873 root_view->AddChildView(password); 873 root_view->AddChildView(password);
874 874
875 normal->SetText(kNormalText); 875 normal->SetText(kNormalText);
876 read_only->SetText(kReadOnlyText); 876 read_only->SetText(kReadOnlyText);
877 password->SetText(kPasswordText); 877 password->SetText(kPasswordText);
878 878
879 // 879 //
(...skipping 2179 matching lines...) Expand 10 before | Expand all | Expand 10 after
3059 ScrambleTree(content); 3059 ScrambleTree(content);
3060 EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer())); 3060 EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer()));
3061 3061
3062 ScrambleTree(content); 3062 ScrambleTree(content);
3063 EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer())); 3063 EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer()));
3064 } 3064 }
3065 3065
3066 #endif // VIEWS_COMPOSITOR 3066 #endif // VIEWS_COMPOSITOR
3067 3067
3068 } // namespace views 3068 } // namespace views
OLDNEW
« ui/views/controls/textfield/textfield.h ('K') | « ui/views/examples/textfield_example.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698