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

Unified Diff: Source/platform/scroll/ProgrammaticScrollAnimator.h

Issue 134443003: Implement CSSOM Smooth Scroll API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 10 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: Source/platform/scroll/ProgrammaticScrollAnimator.h
diff --git a/Source/core/html/LinkImport.h b/Source/platform/scroll/ProgrammaticScrollAnimator.h
similarity index 60%
copy from Source/core/html/LinkImport.h
copy to Source/platform/scroll/ProgrammaticScrollAnimator.h
index 512af3609ccc6a85e4f197be26b60d406f087f98..1b9af4d101613429f312c1208c5527d8d6dba938 100644
--- a/Source/core/html/LinkImport.h
+++ b/Source/platform/scroll/ProgrammaticScrollAnimator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2014 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -28,52 +28,53 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LinkImport_h
-#define LinkImport_h
+#ifndef ProgrammaticScrollAnimator_h
Ian Vollick 2014/02/06 16:02:31 I think you can muck with --similarity to convince
+#define ProgrammaticScrollAnimator_h
-#include "core/html/HTMLImportChildClient.h"
-#include "core/html/LinkResource.h"
+#include "platform/geometry/FloatPoint.h"
#include "wtf/FastAllocBase.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
-#include "wtf/RefPtr.h"
+
+namespace blink {
+class WebScrollOffsetAnimationCurve;
+}
namespace WebCore {
-class Document;
-class HTMLImportChild;
+class FloatPoint;
+class ScrollableArea;
-//
-// A LinkResource subclasss used for @rel=import.
-//
-class LinkImport FINAL : public LinkResource, public HTMLImportChildClient {
+class ProgrammaticScrollAnimator {
+ WTF_MAKE_NONCOPYABLE(ProgrammaticScrollAnimator);
WTF_MAKE_FAST_ALLOCATED;
public:
+ static PassOwnPtr<ProgrammaticScrollAnimator> create(ScrollableArea*);
- static PassOwnPtr<LinkImport> create(HTMLLinkElement* owner);
-
- explicit LinkImport(HTMLLinkElement* owner);
- virtual ~LinkImport();
+ ~ProgrammaticScrollAnimator();
- // LinkResource
- virtual void process() OVERRIDE;
- virtual Type type() const OVERRIDE { return Import; }
- virtual void ownerRemoved() OVERRIDE;
- virtual bool hasLoaded() const OVERRIDE;
+ void animateToOffset(FloatPoint offset);
+ void cancelAnimation();
+ void tickAnimation(double monotonicTime);
- // HTMLImportChildClient
- virtual void didFinish() OVERRIDE;
- virtual void importChildWasDestroyed(HTMLImportChild*) OVERRIDE;
- virtual bool isCreatedByParser() const OVERRIDE;
+ void notifyAnimationStarted(double monotonicTime);
+ void notifyAnimationFinished(double monotonicTime);
- Document* importedDocument() const;
- bool ownsLoader() const;
+ void canUseCompositedScrollAnimationsDidChange();
private:
- void clear();
+ explicit ProgrammaticScrollAnimator(ScrollableArea*);
+
+ void resetAnimationState();
- HTMLImportChild* m_child;
+ ScrollableArea* m_scrollableArea;
+ OwnPtr<blink::WebScrollOffsetAnimationCurve> m_animationCurve;
+ FloatPoint m_targetOffset;
+ int m_animationId;
+ double m_startTime;
};
} // namespace WebCore
-#endif // LinkImport_h
+#endif // ScrollAnimator_h

Powered by Google App Engine
This is Rietveld 408576698