| 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 } | 433 } |
| 434 | 434 |
| 435 std::unique_ptr<InkDrop> LabelButton::CreateInkDrop() { | 435 std::unique_ptr<InkDrop> LabelButton::CreateInkDrop() { |
| 436 return UseFloodFillInkDrop() ? CreateDefaultFloodFillInkDropImpl() | 436 return UseFloodFillInkDrop() ? CreateDefaultFloodFillInkDropImpl() |
| 437 : CustomButton::CreateInkDrop(); | 437 : CustomButton::CreateInkDrop(); |
| 438 } | 438 } |
| 439 | 439 |
| 440 std::unique_ptr<views::InkDropRipple> LabelButton::CreateInkDropRipple() const { | 440 std::unique_ptr<views::InkDropRipple> LabelButton::CreateInkDropRipple() const { |
| 441 return UseFloodFillInkDrop() | 441 return UseFloodFillInkDrop() |
| 442 ? base::MakeUnique<views::FloodFillInkDropRipple>( | 442 ? base::MakeUnique<views::FloodFillInkDropRipple>( |
| 443 GetLocalBounds(), GetInkDropCenterBasedOnLastEvent(), | 443 size(), gfx::Insets(), GetInkDropCenterBasedOnLastEvent(), |
| 444 GetInkDropBaseColor(), ink_drop_visible_opacity()) | 444 GetInkDropBaseColor(), ink_drop_visible_opacity()) |
| 445 : CreateDefaultInkDropRipple( | 445 : CreateDefaultInkDropRipple( |
| 446 image()->GetMirroredBounds().CenterPoint()); | 446 image()->GetMirroredBounds().CenterPoint()); |
| 447 } | 447 } |
| 448 | 448 |
| 449 std::unique_ptr<views::InkDropHighlight> LabelButton::CreateInkDropHighlight() | 449 std::unique_ptr<views::InkDropHighlight> LabelButton::CreateInkDropHighlight() |
| 450 const { | 450 const { |
| 451 return UseFloodFillInkDrop() | 451 return UseFloodFillInkDrop() |
| 452 ? base::MakeUnique<views::InkDropHighlight>( | 452 ? base::MakeUnique<views::InkDropHighlight>( |
| 453 size(), kInkDropSmallCornerRadius, | 453 size(), kInkDropSmallCornerRadius, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 : PlatformStyle::TextColorForButton(button_state_colors_, *this); | 603 : PlatformStyle::TextColorForButton(button_state_colors_, *this); |
| 604 if (state() != STATE_DISABLED && label_->enabled_color() != color) | 604 if (state() != STATE_DISABLED && label_->enabled_color() != color) |
| 605 label_->SetEnabledColor(color); | 605 label_->SetEnabledColor(color); |
| 606 } | 606 } |
| 607 | 607 |
| 608 bool LabelButton::UseFloodFillInkDrop() const { | 608 bool LabelButton::UseFloodFillInkDrop() const { |
| 609 return !GetText().empty(); | 609 return !GetText().empty(); |
| 610 } | 610 } |
| 611 | 611 |
| 612 } // namespace views | 612 } // namespace views |
| OLD | NEW |