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

Unified Diff: ui/views/animation/test/test_ink_drop_host.cc

Issue 2447523002: [ash-md] Added different highlighting modes to the InkDropImpl. (Closed)
Patch Set: Fixed compile errors. Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/animation/test/test_ink_drop_host.cc
diff --git a/ui/views/animation/test/test_ink_drop_host.cc b/ui/views/animation/test/test_ink_drop_host.cc
index 1ff7fc5956b0a95b21623281f892212f2c664511..b946e9ad4381f070d550fe023a73f6d72d44d308 100644
--- a/ui/views/animation/test/test_ink_drop_host.cc
+++ b/ui/views/animation/test/test_ink_drop_host.cc
@@ -7,6 +7,7 @@
#include "base/memory/ptr_util.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/animation/ink_drop_highlight.h"
+#include "ui/views/animation/ink_drop_impl.h"
#include "ui/views/animation/square_ink_drop_ripple.h"
#include "ui/views/animation/test/ink_drop_highlight_test_api.h"
#include "ui/views/animation/test/square_ink_drop_ripple_test_api.h"
@@ -25,16 +26,14 @@ class TestInkDropRipple : public SquareInkDropRipple {
int small_corner_radius,
const gfx::Point& center_point,
SkColor color,
- float visible_opacity,
- bool overrides_highlight)
+ float visible_opacity)
: SquareInkDropRipple(large_size,
large_corner_radius,
small_size,
small_corner_radius,
center_point,
color,
- visible_opacity),
- overrides_highlight_(overrides_highlight) {}
+ visible_opacity) {}
~TestInkDropRipple() override {}
@@ -44,13 +43,8 @@ class TestInkDropRipple : public SquareInkDropRipple {
return test_api_.get();
}
- bool OverridesHighlight() const override {
- return overrides_highlight_;
- }
-
private:
std::unique_ptr<test::InkDropRippleTestApi> test_api_;
- bool overrides_highlight_;
DISALLOW_COPY_AND_ASSIGN(TestInkDropRipple);
};
@@ -98,11 +92,19 @@ void TestInkDropHost::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
++num_ink_drop_layers_removed_;
}
+std::unique_ptr<InkDrop> TestInkDropHost::CreateInkDrop() {
+ std::unique_ptr<InkDropImpl> ink_drop = base::MakeUnique<InkDropImpl>(this);
+ if (ripple_overrides_highlight_) {
+ ink_drop->SetAutoHighlightMode(
+ InkDropImpl::AutoHighlightMode::HIDE_ON_RIPPLE);
+ }
+ return ink_drop;
+}
+
std::unique_ptr<InkDropRipple> TestInkDropHost::CreateInkDropRipple() const {
gfx::Size size(10, 10);
- std::unique_ptr<InkDropRipple> ripple(
- new TestInkDropRipple(size, 5, size, 5, gfx::Point(), SK_ColorBLACK,
- 0.175f, ripple_overrides_highlight_));
+ std::unique_ptr<InkDropRipple> ripple(new TestInkDropRipple(
+ size, 5, size, 5, gfx::Point(), SK_ColorBLACK, 0.175f));
if (disable_timers_for_test_)
ripple->GetTestApi()->SetDisableAnimationTimers(true);
return ripple;

Powered by Google App Engine
This is Rietveld 408576698