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

Side by Side Diff: ui/views/controls/button/label_button.cc

Issue 809903005: ui/views: Cleanup usage of scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no need of Pass() Created 5 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
« no previous file with comments | « ui/views/border.cc ('k') | ui/views/event_monitor_aura.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/controls/button/label_button.h" 5 #include "ui/views/controls/button/label_button.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ui/gfx/animation/throb_animation.h" 9 #include "ui/gfx/animation/throb_animation.h"
10 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 328
329 image_->SetBoundsRect(gfx::Rect(image_origin, image_size)); 329 image_->SetBoundsRect(gfx::Rect(image_origin, image_size));
330 label_->SetBoundsRect(gfx::Rect(label_origin, label_size)); 330 label_->SetBoundsRect(gfx::Rect(label_origin, label_size));
331 } 331 }
332 332
333 const char* LabelButton::GetClassName() const { 333 const char* LabelButton::GetClassName() const {
334 return kViewClassName; 334 return kViewClassName;
335 } 335 }
336 336
337 scoped_ptr<LabelButtonBorder> LabelButton::CreateDefaultBorder() const { 337 scoped_ptr<LabelButtonBorder> LabelButton::CreateDefaultBorder() const {
338 return scoped_ptr<LabelButtonBorder>(new LabelButtonBorder(style_)); 338 return make_scoped_ptr(new LabelButtonBorder(style_));
339 } 339 }
340 340
341 void LabelButton::SetBorder(scoped_ptr<Border> border) { 341 void LabelButton::SetBorder(scoped_ptr<Border> border) {
342 border_is_themed_border_ = false; 342 border_is_themed_border_ = false;
343 View::SetBorder(border.Pass()); 343 View::SetBorder(border.Pass());
344 ResetCachedPreferredSize(); 344 ResetCachedPreferredSize();
345 } 345 }
346 346
347 gfx::Rect LabelButton::GetChildAreaBounds() { 347 gfx::Rect LabelButton::GetChildAreaBounds() {
348 return GetLocalBounds(); 348 return GetLocalBounds();
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 GetExtraParams(params); 509 GetExtraParams(params);
510 return ui::NativeTheme::kHovered; 510 return ui::NativeTheme::kHovered;
511 } 511 }
512 512
513 void LabelButton::ResetCachedPreferredSize() { 513 void LabelButton::ResetCachedPreferredSize() {
514 cached_preferred_size_valid_ = false; 514 cached_preferred_size_valid_ = false;
515 cached_preferred_size_= gfx::Size(); 515 cached_preferred_size_= gfx::Size();
516 } 516 }
517 517
518 } // namespace views 518 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/border.cc ('k') | ui/views/event_monitor_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698