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

Unified Diff: ui/views/animation/ink_drop_factory.cc

Issue 1937353002: Rename of InkDropAnimationController classes to InkDrop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed tdanderson@ comments from patch set 2. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/animation/ink_drop_factory.h ('k') | ui/views/animation/ink_drop_factory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_factory.cc
diff --git a/ui/views/animation/ink_drop_factory.cc b/ui/views/animation/ink_drop_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f67f6b68cd123bb036114715f1e0a4e0087f7d71
--- /dev/null
+++ b/ui/views/animation/ink_drop_factory.cc
@@ -0,0 +1,71 @@
+// 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.
+
+#include "ui/views/animation/ink_drop_factory.h"
+
+#include "base/macros.h"
+#include "base/memory/ptr_util.h"
+#include "ui/base/material_design/material_design_controller.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/views/animation/ink_drop.h"
+#include "ui/views/animation/ink_drop_impl.h"
+#include "ui/views/views_export.h"
+
+namespace views {
+
+namespace {
+
+// A stub implementation of an InkDrop that can be used when material design is
+// not enabled.
+class InkDropStub : public InkDrop {
+ public:
+ explicit InkDropStub();
+ ~InkDropStub() override;
+
+ // InkDrop:
+ InkDropState GetTargetInkDropState() const override;
+ bool IsVisible() const override;
+ void AnimateToState(InkDropState state) override;
+ void SnapToActivated() override;
+ void SetHovered(bool is_hovered) override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(InkDropStub);
+};
+
+InkDropStub::InkDropStub() {}
+
+InkDropStub::~InkDropStub() {}
+
+InkDropState InkDropStub::GetTargetInkDropState() const {
+ return InkDropState::HIDDEN;
+}
+
+bool InkDropStub::IsVisible() const {
+ return false;
+}
+
+void InkDropStub::AnimateToState(InkDropState state) {}
+
+void InkDropStub::SnapToActivated() {}
+
+void InkDropStub::SetHovered(bool is_hovered) {}
+
+} // namespace
+
+InkDropFactory::InkDropFactory() {}
+
+InkDropFactory::~InkDropFactory() {}
+
+std::unique_ptr<InkDrop> InkDropFactory::CreateInkDrop(
+ InkDropHost* ink_drop_host) {
+ if (ui::MaterialDesignController::IsModeMaterial()) {
+ return base::WrapUnique(new InkDropImpl(ink_drop_host));
+ }
+
+ return base::WrapUnique(new InkDropStub());
+}
+
+} // namespace views
« no previous file with comments | « ui/views/animation/ink_drop_factory.h ('k') | ui/views/animation/ink_drop_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698