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

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

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT 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/button_example.cc ('k') | ui/views/examples/multiline_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) 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 14 matching lines...) Expand all
25 virtual ~PreferredSizeLabel(); 25 virtual ~PreferredSizeLabel();
26 26
27 // Label: 27 // Label:
28 virtual gfx::Size GetPreferredSize() OVERRIDE; 28 virtual gfx::Size GetPreferredSize() OVERRIDE;
29 29
30 private: 30 private:
31 DISALLOW_COPY_AND_ASSIGN(PreferredSizeLabel); 31 DISALLOW_COPY_AND_ASSIGN(PreferredSizeLabel);
32 }; 32 };
33 33
34 PreferredSizeLabel::PreferredSizeLabel() : Label() { 34 PreferredSizeLabel::PreferredSizeLabel() : Label() {
35 set_border(Border::CreateSolidBorder(2, SK_ColorCYAN)); 35 SetBorder(Border::CreateSolidBorder(2, SK_ColorCYAN));
36 } 36 }
37 37
38 PreferredSizeLabel::~PreferredSizeLabel() {} 38 PreferredSizeLabel::~PreferredSizeLabel() {}
39 39
40 gfx::Size PreferredSizeLabel::GetPreferredSize() { return gfx::Size(100, 40); } 40 gfx::Size PreferredSizeLabel::GetPreferredSize() { return gfx::Size(100, 40); }
41 41
42 } // namespace 42 } // namespace
43 43
44 LabelExample::LabelExample() : ExampleBase("Label") {} 44 LabelExample::LabelExample() : ExampleBase("Label") {}
45 45
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 } 85 }
86 86
87 } // namespace examples 87 } // namespace examples
88 } // namespace views 88 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/button_example.cc ('k') | ui/views/examples/multiline_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698