Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_OVERSCROLL_ANIMATOR_SLIDE R_MAC_H_ | |
| 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_OVERSCROLL_ANIMATOR_SLIDE R_MAC_H_ | |
| 7 | |
| 8 #include "base/mac/scoped_nsobject.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #import <Cocoa/Cocoa.h> | |
| 11 #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
| |
| 12 | |
| 13 namespace content { | |
| 14 class WebContentsPaintObserver; | |
| 15 } | |
| 16 | |
| 17 @interface OverscrollAnimatorSliderView | |
| 18 : NSView<WebContentsOverscrollAnimator> { | |
| 19 // This container view holds the RenderWidgetHost's NativeViews. Most of the | |
| 20 // 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.
| |
| 21 // screen coordinates. During an overscroll animation, it may temporarily be | |
| 22 // relocated, but it will return to its original position after the overscroll | |
| 23 // animation is finished. | |
| 24 base::scoped_nsobject<NSView> middleView_; | |
| 25 | |
| 26 // This view is a sibling of middleView_, and is guaranteed to live below it. | |
| 27 // Most of the time, it is hidden. During an overscroll animation to the left, | |
| 28 // middleView_ is slid to the right, and bottomView_ peeks out from the | |
| 29 // original position of middleView_. | |
| 30 base::scoped_nsobject<NSImageView> bottomView_; | |
| 31 | |
| 32 // This view is a sibling of middleView_, and is guaranteed to live above it. | |
| 33 // Most of the time, it is hidden. During an overscroll animation to the | |
| 34 // right, topView_ is slid to the left from off screen, its final position | |
| 35 // 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
| |
| 36 base::scoped_nsobject<NSImageView> topView_; | |
| 37 | |
| 38 // Indicates whether the current overscroll animation is to the left or the | |
| 39 // right. This property has no meaning when inOverscroll_ is false. | |
| 40 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.
| |
| 41 | |
| 42 // Indicates that this view is completing or cancelling the overscroll. This | |
| 43 // animation cannot be cancelled. | |
| 44 BOOL animating_; | |
| 45 | |
| 46 // Reflects whether this view is in the process of handling an overscroll. | |
| 47 BOOL inOverscroll_; | |
| 48 | |
| 49 // The most recent value passed to -updateOverscrollProgress:. | |
| 50 CGFloat progress_; | |
| 51 | |
| 52 // An observer that reports the first non-empty paint of a WebContents. This | |
| 53 // is used when completing an overscroll animation. | |
| 54 scoped_ptr<content::WebContentsPaintObserver> observer_; | |
| 55 } | |
| 56 @end | |
| 57 | |
| 58 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_OVERSCROLL_ANIMATOR_SL IDER_MAC_H_ | |
| OLD | NEW |