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

Unified Diff: ui/views/animation/test/square_ink_drop_ripple_test_api.h

Issue 1937103003: Rename of InkDropAnimation classes to InkDropRipple. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed test_ink_drop_animation_observer.h from views.gyp and doc update. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/animation/test/square_ink_drop_ripple_test_api.h
diff --git a/ui/views/animation/test/square_ink_drop_ripple_test_api.h b/ui/views/animation/test/square_ink_drop_ripple_test_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..ba9602805b132e35341e7c1dc571ffed887247e3
--- /dev/null
+++ b/ui/views/animation/test/square_ink_drop_ripple_test_api.h
@@ -0,0 +1,63 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_ANIMATION_TEST_SQUARE_INK_DROP_RIPPLE_TEST_API_H_
+#define UI_VIEWS_ANIMATION_TEST_SQUARE_INK_DROP_RIPPLE_TEST_API_H_
+
+#include <vector>
+
+#include "base/macros.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/views/animation/square_ink_drop_ripple.h"
+#include "ui/views/animation/test/ink_drop_ripple_test_api.h"
+
+namespace ui {
+class LayerAnimator;
+} // namespace ui
+
+namespace views {
+namespace test {
+
+// Test API to provide internal access to a SquareInkDropRipple.
+class SquareInkDropRippleTestApi : public InkDropRippleTestApi {
+ public:
+ // Make the private typedefs accessible.
+ using InkDropTransforms = SquareInkDropRipple::InkDropTransforms;
+ using PaintedShape = SquareInkDropRipple::PaintedShape;
+
+ explicit SquareInkDropRippleTestApi(SquareInkDropRipple* ink_drop_ripple);
+ ~SquareInkDropRippleTestApi() override;
+
+ // Wrapper functions to the wrapped InkDropRipple:
+ void CalculateCircleTransforms(const gfx::Size& size,
+ InkDropTransforms* transforms_out) const;
+ void CalculateRectTransforms(const gfx::Size& size,
+ float corner_radius,
+ InkDropTransforms* transforms_out) const;
+
+ // InkDropRippleTestApi:
+ float GetCurrentOpacity() const override;
+
+ protected:
+ // InkDropRippleTestApi:
+ std::vector<ui::LayerAnimator*> GetLayerAnimators() override;
+
+ private:
+ SquareInkDropRipple* ink_drop_ripple() {
+ return static_cast<const SquareInkDropRippleTestApi*>(this)
+ ->ink_drop_ripple();
+ }
+
+ SquareInkDropRipple* ink_drop_ripple() const {
+ return static_cast<SquareInkDropRipple*>(
+ InkDropRippleTestApi::ink_drop_ripple());
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(SquareInkDropRippleTestApi);
+};
+
+} // namespace test
+} // namespace views
+
+#endif // UI_VIEWS_ANIMATION_TEST_SQUARE_INK_DROP_RIPPLE_TEST_API_H_

Powered by Google App Engine
This is Rietveld 408576698