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

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

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 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
« no previous file with comments | « ui/views/examples/menu_example.cc ('k') | ui/views/examples/tree_view_example.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/multiline_example.h" 5 #include "ui/views/examples/multiline_example.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 InvalidateLayout(); 106 InvalidateLayout();
107 } 107 }
108 108
109 private: 109 private:
110 void OnBoundsChanged(const gfx::Rect& previous_bounds) override { 110 void OnBoundsChanged(const gfx::Rect& previous_bounds) override {
111 gfx::Rect bounds = GetLocalBounds(); 111 gfx::Rect bounds = GetLocalBounds();
112 bounds.Inset(GetInsets()); 112 bounds.Inset(GetInsets());
113 render_text_->SetDisplayRect(bounds); 113 render_text_->SetDisplayRect(bounds);
114 } 114 }
115 115
116 scoped_ptr<gfx::RenderText> render_text_; 116 std::unique_ptr<gfx::RenderText> render_text_;
117 117
118 DISALLOW_COPY_AND_ASSIGN(RenderTextView); 118 DISALLOW_COPY_AND_ASSIGN(RenderTextView);
119 }; 119 };
120 120
121 MultilineExample::MultilineExample() 121 MultilineExample::MultilineExample()
122 : ExampleBase("Multiline RenderText"), 122 : ExampleBase("Multiline RenderText"),
123 render_text_view_(NULL), 123 render_text_view_(NULL),
124 label_(NULL), 124 label_(NULL),
125 textfield_(NULL), 125 textfield_(NULL),
126 label_checkbox_(NULL) { 126 label_checkbox_(NULL) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 void MultilineExample::ButtonPressed(Button* sender, const ui::Event& event) { 185 void MultilineExample::ButtonPressed(Button* sender, const ui::Event& event) {
186 DCHECK_EQ(sender, label_checkbox_); 186 DCHECK_EQ(sender, label_checkbox_);
187 label_->SetText(label_checkbox_->checked() ? textfield_->text() : 187 label_->SetText(label_checkbox_->checked() ? textfield_->text() :
188 base::string16()); 188 base::string16());
189 container()->Layout(); 189 container()->Layout();
190 container()->SchedulePaint(); 190 container()->SchedulePaint();
191 } 191 }
192 192
193 } // namespace examples 193 } // namespace examples
194 } // namespace views 194 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/menu_example.cc ('k') | ui/views/examples/tree_view_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698