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

Side by Side Diff: ui/views/examples/label_example.cc

Issue 222033002: Add an 'obscured' flag to views::Label. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: *facepalm* Created 6 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
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 "ui/views/examples/label_example.h" 5 #include "ui/views/examples/label_example.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/views/border.h" 8 #include "ui/views/border.h"
9 #include "ui/views/controls/label.h" 9 #include "ui/views/controls/label.h"
10 #include "ui/views/layout/box_layout.h" 10 #include "ui/views/layout/box_layout.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 label = new PreferredSizeLabel(); 75 label = new PreferredSizeLabel();
76 label->SetText(ASCIIToUTF16("A long label will elide toward its logical end " 76 label->SetText(ASCIIToUTF16("A long label will elide toward its logical end "
77 "if the text's width exceeds the label's available width.")); 77 "if the text's width exceeds the label's available width."));
78 container->AddChildView(label); 78 container->AddChildView(label);
79 79
80 label = new PreferredSizeLabel(); 80 label = new PreferredSizeLabel();
81 label->SetText(ASCIIToUTF16("A multi-line label will wrap onto subsequent " 81 label->SetText(ASCIIToUTF16("A multi-line label will wrap onto subsequent "
82 "lines if the text's width exceeds the label's available width.")); 82 "lines if the text's width exceeds the label's available width."));
83 label->SetMultiLine(true); 83 label->SetMultiLine(true);
84 container->AddChildView(label); 84 container->AddChildView(label);
85
86 label = new Label(WideToUTF16(L"Password!"));
87 label->SetObscured(true);
88 container->AddChildView(label);
85 } 89 }
86 90
87 } // namespace examples 91 } // namespace examples
88 } // namespace views 92 } // namespace views
OLDNEW
« ui/views/controls/label_unittest.cc ('K') | « ui/views/controls/label_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698