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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 image()->SetPaintToLayer(false); | 417 image()->SetPaintToLayer(false); |
418 ink_drop_container_->layer()->Remove(ink_drop_layer); | 418 ink_drop_container_->layer()->Remove(ink_drop_layer); |
419 ink_drop_container_->SetVisible(false); | 419 ink_drop_container_->SetVisible(false); |
420 } | 420 } |
421 | 421 |
422 std::unique_ptr<views::InkDropAnimation> LabelButton::CreateInkDropAnimation() | 422 std::unique_ptr<views::InkDropAnimation> LabelButton::CreateInkDropAnimation() |
423 const { | 423 const { |
424 return GetText().empty() | 424 return GetText().empty() |
425 ? CustomButton::CreateInkDropAnimation() | 425 ? CustomButton::CreateInkDropAnimation() |
426 : base::WrapUnique(new views::FloodFillInkDropAnimation( | 426 : base::WrapUnique(new views::FloodFillInkDropAnimation( |
427 size(), GetInkDropCenter(), GetInkDropBaseColor())); | 427 GetLocalBounds(), GetInkDropCenter(), |
| 428 GetInkDropBaseColor())); |
428 } | 429 } |
429 | 430 |
430 std::unique_ptr<views::InkDropHover> LabelButton::CreateInkDropHover() const { | 431 std::unique_ptr<views::InkDropHover> LabelButton::CreateInkDropHover() const { |
431 if (!ShouldShowInkDropHover()) | 432 if (!ShouldShowInkDropHover()) |
432 return nullptr; | 433 return nullptr; |
433 return GetText().empty() ? CustomButton::CreateInkDropHover() | 434 return GetText().empty() ? CustomButton::CreateInkDropHover() |
434 : base::WrapUnique(new views::InkDropHover( | 435 : base::WrapUnique(new views::InkDropHover( |
435 size(), kInkDropSmallCornerRadius, | 436 size(), kInkDropSmallCornerRadius, |
436 GetInkDropCenter(), GetInkDropBaseColor())); | 437 GetInkDropCenter(), GetInkDropBaseColor())); |
437 } | 438 } |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 void LabelButton::ResetLabelEnabledColor() { | 564 void LabelButton::ResetLabelEnabledColor() { |
564 const SkColor color = | 565 const SkColor color = |
565 explicitly_set_colors_[state()] | 566 explicitly_set_colors_[state()] |
566 ? button_state_colors_[state()] | 567 ? button_state_colors_[state()] |
567 : PlatformStyle::TextColorForButton(button_state_colors_, *this); | 568 : PlatformStyle::TextColorForButton(button_state_colors_, *this); |
568 if (state() != STATE_DISABLED && label_->enabled_color() != color) | 569 if (state() != STATE_DISABLED && label_->enabled_color() != color) |
569 label_->SetEnabledColor(color); | 570 label_->SetEnabledColor(color); |
570 } | 571 } |
571 | 572 |
572 } // namespace views | 573 } // namespace views |
OLD | NEW |