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

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

Issue 659713003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify Created 6 years, 2 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/controls/button/checkbox.cc ('k') | ui/views/controls/combobox/combobox.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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 scoped_ptr<LabelButtonBorder> label_button_border = CreateDefaultBorder(); 437 scoped_ptr<LabelButtonBorder> label_button_border = CreateDefaultBorder();
438 438
439 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 439 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
440 views::LinuxUI* linux_ui = views::LinuxUI::instance(); 440 views::LinuxUI* linux_ui = views::LinuxUI::instance();
441 if (linux_ui) { 441 if (linux_ui) {
442 SetBorder(linux_ui->CreateNativeBorder( 442 SetBorder(linux_ui->CreateNativeBorder(
443 this, label_button_border.Pass())); 443 this, label_button_border.Pass()));
444 } else 444 } else
445 #endif 445 #endif
446 { 446 {
447 SetBorder(label_button_border.PassAs<Border>()); 447 SetBorder(label_button_border.Pass());
448 } 448 }
449 449
450 border_is_themed_border_ = true; 450 border_is_themed_border_ = true;
451 } 451 }
452 452
453 void LabelButton::StateChanged() { 453 void LabelButton::StateChanged() {
454 const gfx::Size previous_image_size(image_->GetPreferredSize()); 454 const gfx::Size previous_image_size(image_->GetPreferredSize());
455 UpdateImage(); 455 UpdateImage();
456 const SkColor color = button_state_colors_[state()]; 456 const SkColor color = button_state_colors_[state()];
457 if (state() != STATE_DISABLED && label_->enabled_color() != color) 457 if (state() != STATE_DISABLED && label_->enabled_color() != color)
(...skipping 51 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/controls/button/checkbox.cc ('k') | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698