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

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

Issue 1915983009: Fixed material design ink drop location for the MD download shelf buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "Removed FloodFillInkDropAnimation ctor. Created 4 years, 7 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/ink_drop_animation_unittest.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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « ui/views/animation/ink_drop_animation_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698