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

Side by Side Diff: ui/views/animation/test/test_ink_drop_host.cc

Issue 2094343005: Fix MD button hover shadow effect on odd-sized buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/animation/test/test_ink_drop_host.h" 5 #include "ui/views/animation/test/test_ink_drop_host.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "ui/gfx/geometry/size.h" 8 #include "ui/gfx/geometry/size.h"
9 #include "ui/views/animation/ink_drop_highlight.h" 9 #include "ui/views/animation/ink_drop_highlight.h"
10 #include "ui/views/animation/square_ink_drop_ripple.h" 10 #include "ui/views/animation/square_ink_drop_ripple.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 DISALLOW_COPY_AND_ASSIGN(TestInkDropRipple); 48 DISALLOW_COPY_AND_ASSIGN(TestInkDropRipple);
49 }; 49 };
50 50
51 // Test specific subclass of InkDropHighlight that returns a test api from 51 // Test specific subclass of InkDropHighlight that returns a test api from
52 // GetTestApi(). 52 // GetTestApi().
53 class TestInkDropHighlight : public InkDropHighlight { 53 class TestInkDropHighlight : public InkDropHighlight {
54 public: 54 public:
55 TestInkDropHighlight(const gfx::Size& size, 55 TestInkDropHighlight(const gfx::Size& size,
56 int corner_radius, 56 int corner_radius,
57 const gfx::Point& center_point, 57 const gfx::PointF& center_point,
58 SkColor color) 58 SkColor color)
59 : InkDropHighlight(size, corner_radius, center_point, color) {} 59 : InkDropHighlight(size, corner_radius, center_point, color) {}
60 60
61 ~TestInkDropHighlight() override {} 61 ~TestInkDropHighlight() override {}
62 62
63 test::InkDropHighlightTestApi* GetTestApi() override { 63 test::InkDropHighlightTestApi* GetTestApi() override {
64 if (!test_api_) 64 if (!test_api_)
65 test_api_.reset(new test::InkDropHighlightTestApi(this)); 65 test_api_.reset(new test::InkDropHighlightTestApi(this));
66 return test_api_.get(); 66 return test_api_.get();
67 } 67 }
(...skipping 27 matching lines...) Expand all
95 size, 5, size, 5, gfx::Point(), SK_ColorBLACK, 0.175f)); 95 size, 5, size, 5, gfx::Point(), SK_ColorBLACK, 0.175f));
96 if (disable_timers_for_test_) 96 if (disable_timers_for_test_)
97 ripple->GetTestApi()->SetDisableAnimationTimers(true); 97 ripple->GetTestApi()->SetDisableAnimationTimers(true);
98 return ripple; 98 return ripple;
99 } 99 }
100 100
101 std::unique_ptr<InkDropHighlight> TestInkDropHost::CreateInkDropHighlight() 101 std::unique_ptr<InkDropHighlight> TestInkDropHost::CreateInkDropHighlight()
102 const { 102 const {
103 std::unique_ptr<InkDropHighlight> highlight; 103 std::unique_ptr<InkDropHighlight> highlight;
104 if (should_show_highlight_) { 104 if (should_show_highlight_) {
105 highlight.reset(new TestInkDropHighlight(gfx::Size(10, 10), 4, gfx::Point(), 105 highlight.reset(new TestInkDropHighlight(gfx::Size(10, 10), 4,
106 SK_ColorBLACK)); 106 gfx::PointF(), SK_ColorBLACK));
107 if (disable_timers_for_test_) 107 if (disable_timers_for_test_)
108 highlight->GetTestApi()->SetDisableAnimationTimers(true); 108 highlight->GetTestApi()->SetDisableAnimationTimers(true);
109 } 109 }
110 return highlight; 110 return highlight;
111 } 111 }
112 112
113 } // namespace views 113 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698