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

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

Issue 1942843002: Fixed material design ink drop location for the MD download shelf buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Replaced uniqe_ptr with scoped_ptr. 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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 void LabelButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { 410 void LabelButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
411 image()->SetPaintToLayer(false); 411 image()->SetPaintToLayer(false);
412 ink_drop_container_->layer()->Remove(ink_drop_layer); 412 ink_drop_container_->layer()->Remove(ink_drop_layer);
413 ink_drop_container_->SetVisible(false); 413 ink_drop_container_->SetVisible(false);
414 } 414 }
415 415
416 scoped_ptr<views::InkDropAnimation> LabelButton::CreateInkDropAnimation() 416 scoped_ptr<views::InkDropAnimation> LabelButton::CreateInkDropAnimation()
417 const { 417 const {
418 return GetText().empty() 418 return GetText().empty()
419 ? CustomButton::CreateInkDropAnimation() 419 ? CustomButton::CreateInkDropAnimation()
420 : make_scoped_ptr(new views::FloodFillInkDropAnimation( 420 : make_scoped_ptr(new views::FloodFillInkDropAnimation(
bruthig 2016/05/02 14:45:22 FYI I this was using a unique_ptr and I changed it
421 size(), GetInkDropCenter(), GetInkDropBaseColor())); 421 GetLocalBounds(), GetInkDropCenter(),
422 GetInkDropBaseColor()));
422 } 423 }
423 424
424 scoped_ptr<views::InkDropHover> LabelButton::CreateInkDropHover() const { 425 scoped_ptr<views::InkDropHover> LabelButton::CreateInkDropHover() const {
425 if (!ShouldShowInkDropHover()) 426 if (!ShouldShowInkDropHover())
426 return nullptr; 427 return nullptr;
427 return GetText().empty() ? CustomButton::CreateInkDropHover() 428 return GetText().empty() ? CustomButton::CreateInkDropHover()
428 : make_scoped_ptr(new views::InkDropHover( 429 : make_scoped_ptr(new views::InkDropHover(
429 size(), kInkDropSmallCornerRadius, 430 size(), kInkDropSmallCornerRadius,
430 GetInkDropCenter(), GetInkDropBaseColor())); 431 GetInkDropCenter(), GetInkDropBaseColor()));
431 } 432 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 GetExtraParams(params); 568 GetExtraParams(params);
568 return ui::NativeTheme::kHovered; 569 return ui::NativeTheme::kHovered;
569 } 570 }
570 571
571 void LabelButton::ResetCachedPreferredSize() { 572 void LabelButton::ResetCachedPreferredSize() {
572 cached_preferred_size_valid_ = false; 573 cached_preferred_size_valid_ = false;
573 cached_preferred_size_ = gfx::Size(); 574 cached_preferred_size_ = gfx::Size();
574 } 575 }
575 576
576 } // namespace views 577 } // 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