Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 410 void LabelButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { | 410 void LabelButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
| 411 image()->SetPaintToLayer(false); | 411 image()->SetPaintToLayer(false); |
| 412 ink_drop_container_->layer()->Remove(ink_drop_layer); | 412 ink_drop_container_->layer()->Remove(ink_drop_layer); |
| 413 ink_drop_container_->SetVisible(false); | 413 ink_drop_container_->SetVisible(false); |
| 414 } | 414 } |
| 415 | 415 |
| 416 scoped_ptr<views::InkDropAnimation> LabelButton::CreateInkDropAnimation() | 416 scoped_ptr<views::InkDropAnimation> LabelButton::CreateInkDropAnimation() |
| 417 const { | 417 const { |
| 418 return GetText().empty() | 418 return GetText().empty() |
| 419 ? CustomButton::CreateInkDropAnimation() | 419 ? CustomButton::CreateInkDropAnimation() |
| 420 : make_scoped_ptr(new views::FloodFillInkDropAnimation( | 420 : make_scoped_ptr(new views::FloodFillInkDropAnimation( |
|
bruthig
2016/05/02 14:45:22
FYI I this was using a unique_ptr and I changed it
| |
| 421 size(), GetInkDropCenter(), GetInkDropBaseColor())); | 421 GetLocalBounds(), GetInkDropCenter(), |
| 422 GetInkDropBaseColor())); | |
| 422 } | 423 } |
| 423 | 424 |
| 424 scoped_ptr<views::InkDropHover> LabelButton::CreateInkDropHover() const { | 425 scoped_ptr<views::InkDropHover> LabelButton::CreateInkDropHover() const { |
| 425 if (!ShouldShowInkDropHover()) | 426 if (!ShouldShowInkDropHover()) |
| 426 return nullptr; | 427 return nullptr; |
| 427 return GetText().empty() ? CustomButton::CreateInkDropHover() | 428 return GetText().empty() ? CustomButton::CreateInkDropHover() |
| 428 : make_scoped_ptr(new views::InkDropHover( | 429 : make_scoped_ptr(new views::InkDropHover( |
| 429 size(), kInkDropSmallCornerRadius, | 430 size(), kInkDropSmallCornerRadius, |
| 430 GetInkDropCenter(), GetInkDropBaseColor())); | 431 GetInkDropCenter(), GetInkDropBaseColor())); |
| 431 } | 432 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 567 GetExtraParams(params); | 568 GetExtraParams(params); |
| 568 return ui::NativeTheme::kHovered; | 569 return ui::NativeTheme::kHovered; |
| 569 } | 570 } |
| 570 | 571 |
| 571 void LabelButton::ResetCachedPreferredSize() { | 572 void LabelButton::ResetCachedPreferredSize() { |
| 572 cached_preferred_size_valid_ = false; | 573 cached_preferred_size_valid_ = false; |
| 573 cached_preferred_size_ = gfx::Size(); | 574 cached_preferred_size_ = gfx::Size(); |
| 574 } | 575 } |
| 575 | 576 |
| 576 } // namespace views | 577 } // namespace views |
| OLD | NEW |