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

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

Issue 2533053002: Handle view resize for ripple (Closed)
Patch Set: const -> constexpr Created 4 years 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
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 <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
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(), 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
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
OLDNEW
« no previous file with comments | « ui/views/animation/ink_drop_ripple_unittest.cc ('k') | ui/views/controls/button/md_text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698