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 2250783002: Allow InkDropRipple to co-exist with highlight (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove EmptyInkDropRipple Created 4 years, 3 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/animation/test/test_ink_drop_host.cc ('k') | no next file » | 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 void LabelButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { 441 void LabelButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
442 image()->SetPaintToLayer(false); 442 image()->SetPaintToLayer(false);
443 ink_drop_container_->layer()->Remove(ink_drop_layer); 443 ink_drop_container_->layer()->Remove(ink_drop_layer);
444 ink_drop_container_->SetVisible(false); 444 ink_drop_container_->SetVisible(false);
445 } 445 }
446 446
447 std::unique_ptr<views::InkDropRipple> LabelButton::CreateInkDropRipple() const { 447 std::unique_ptr<views::InkDropRipple> LabelButton::CreateInkDropRipple() const {
448 return GetText().empty() 448 return GetText().empty()
449 ? CreateDefaultInkDropRipple( 449 ? CreateDefaultInkDropRipple(
450 image()->GetMirroredBounds().CenterPoint()) 450 image()->GetMirroredBounds().CenterPoint())
451 : std::unique_ptr<views::InkDropRipple>( 451 : base::MakeUnique<views::FloodFillInkDropRipple>(
452 new views::FloodFillInkDropRipple( 452 GetLocalBounds(), GetInkDropCenterBasedOnLastEvent(),
453 GetLocalBounds(), GetInkDropCenterBasedOnLastEvent(), 453 GetInkDropBaseColor(), ink_drop_visible_opacity());
454 GetInkDropBaseColor(), ink_drop_visible_opacity()));
455 } 454 }
456 455
457 std::unique_ptr<views::InkDropHighlight> LabelButton::CreateInkDropHighlight() 456 std::unique_ptr<views::InkDropHighlight> LabelButton::CreateInkDropHighlight()
458 const { 457 const {
459 if (!ShouldShowInkDropHighlight()) 458 if (!ShouldShowInkDropHighlight())
460 return nullptr; 459 return nullptr;
461 return GetText().empty() 460 return GetText().empty()
462 ? CreateDefaultInkDropHighlight( 461 ? CreateDefaultInkDropHighlight(
463 gfx::RectF(image()->GetMirroredBounds()).CenterPoint()) 462 gfx::RectF(image()->GetMirroredBounds()).CenterPoint())
464 : base::MakeUnique<views::InkDropHighlight>( 463 : base::MakeUnique<views::InkDropHighlight>(
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 void LabelButton::ResetLabelEnabledColor() { 608 void LabelButton::ResetLabelEnabledColor() {
610 const SkColor color = 609 const SkColor color =
611 explicitly_set_colors_[state()] 610 explicitly_set_colors_[state()]
612 ? button_state_colors_[state()] 611 ? button_state_colors_[state()]
613 : PlatformStyle::TextColorForButton(button_state_colors_, *this); 612 : PlatformStyle::TextColorForButton(button_state_colors_, *this);
614 if (state() != STATE_DISABLED && label_->enabled_color() != color) 613 if (state() != STATE_DISABLED && label_->enabled_color() != color)
615 label_->SetEnabledColor(color); 614 label_->SetEnabledColor(color);
616 } 615 }
617 616
618 } // namespace views 617 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/test/test_ink_drop_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698