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

Unified Diff: content/browser/web_contents/web_contents_view_overscroll_animator_slider_mac.h

Issue 314393003: mac: Add overscroll animator slider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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: content/browser/web_contents/web_contents_view_overscroll_animator_slider_mac.h
diff --git a/content/browser/web_contents/web_contents_view_overscroll_animator_slider_mac.h b/content/browser/web_contents/web_contents_view_overscroll_animator_slider_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..184f17f77788025d21387b84ce2362cc9d3c0113
--- /dev/null
+++ b/content/browser/web_contents/web_contents_view_overscroll_animator_slider_mac.h
@@ -0,0 +1,58 @@
+// Copyright 2014 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 CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_OVERSCROLL_ANIMATOR_SLIDER_MAC_H_
+#define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_OVERSCROLL_ANIMATOR_SLIDER_MAC_H_
+
+#include "base/mac/scoped_nsobject.h"
+#include "base/memory/scoped_ptr.h"
+#import <Cocoa/Cocoa.h>
+#include "content/browser/web_contents/web_contents_view_overscroll_animator_mac.h"
Avi (use Gerrit) 2014/06/06 23:09:44 C headers, then C++ headers, then Chrome headers.
erikchen 2014/06/07 00:34:03 I've moved <Cocoa/Cocoa.h> to the top, and kept th
+
+namespace content {
+class WebContentsPaintObserver;
+}
+
+@interface OverscrollAnimatorSliderView
+ : NSView<WebContentsOverscrollAnimator> {
+ // This container view holds the RenderWidgetHost's NativeViews. Most of the
+ // time, it's frame in screen coordinates is the same as SliderView's frame in
Avi (use Gerrit) 2014/06/06 23:09:44 s/it's/its/
erikchen 2014/06/07 00:34:04 Done.
+ // screen coordinates. During an overscroll animation, it may temporarily be
+ // relocated, but it will return to its original position after the overscroll
+ // animation is finished.
+ base::scoped_nsobject<NSView> middleView_;
+
+ // This view is a sibling of middleView_, and is guaranteed to live below it.
+ // Most of the time, it is hidden. During an overscroll animation to the left,
+ // middleView_ is slid to the right, and bottomView_ peeks out from the
+ // original position of middleView_.
+ base::scoped_nsobject<NSImageView> bottomView_;
+
+ // This view is a sibling of middleView_, and is guaranteed to live above it.
+ // Most of the time, it is hidden. During an overscroll animation to the
+ // right, topView_ is slid to the left from off screen, its final position
+ // exactly covering middleView_.
Avi (use Gerrit) 2014/06/06 23:09:44 I must admit that I don't get these two comments.
erikchen 2014/06/07 00:34:04 After the rename to use directions instead of left
+ base::scoped_nsobject<NSImageView> topView_;
+
+ // Indicates whether the current overscroll animation is to the left or the
+ // right. This property has no meaning when inOverscroll_ is false.
+ BOOL slidingLeft_;
Avi (use Gerrit) 2014/06/06 23:09:44 Same comment about an enum for here.
erikchen 2014/06/07 00:34:03 Ditto.
+
+ // Indicates that this view is completing or cancelling the overscroll. This
+ // animation cannot be cancelled.
+ BOOL animating_;
+
+ // Reflects whether this view is in the process of handling an overscroll.
+ BOOL inOverscroll_;
+
+ // The most recent value passed to -updateOverscrollProgress:.
+ CGFloat progress_;
+
+ // An observer that reports the first non-empty paint of a WebContents. This
+ // is used when completing an overscroll animation.
+ scoped_ptr<content::WebContentsPaintObserver> observer_;
+}
+@end
+
+#endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_OVERSCROLL_ANIMATOR_SLIDER_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698