| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <QuartzCore/QuartzCore.h> | 5 #import <QuartzCore/QuartzCore.h> |
| 6 | 6 |
| 7 #include "content/browser/web_contents/web_contents_view_overscroll_animator_sli
der_mac.h" | 7 #include "content/browser/web_contents/web_contents_view_overscroll_animator_sli
der_mac.h" |
| 8 | 8 |
| 9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
| 10 #include "content/public/browser/web_contents_observer.h" | 10 #include "content/public/browser/web_contents_observer.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 // Helper Class (WebContentsPaintObserver) ------------------------------------- | 66 // Helper Class (WebContentsPaintObserver) ------------------------------------- |
| 67 | 67 |
| 68 namespace overscroll_animator { | 68 namespace overscroll_animator { |
| 69 class WebContentsPaintObserver : public content::WebContentsObserver { | 69 class WebContentsPaintObserver : public content::WebContentsObserver { |
| 70 public: | 70 public: |
| 71 WebContentsPaintObserver(content::WebContents* web_contents, | 71 WebContentsPaintObserver(content::WebContents* web_contents, |
| 72 OverscrollAnimatorSliderView* slider_view) | 72 OverscrollAnimatorSliderView* slider_view) |
| 73 : WebContentsObserver(web_contents), slider_view_(slider_view) {} | 73 : WebContentsObserver(web_contents), slider_view_(slider_view) {} |
| 74 | 74 |
| 75 virtual void DidFirstVisuallyNonEmptyPaint() override { | 75 void DidFirstVisuallyNonEmptyPaint() override { |
| 76 [slider_view_ webContentsFinishedNonEmptyPaint]; | 76 [slider_view_ webContentsFinishedNonEmptyPaint]; |
| 77 } | 77 } |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 OverscrollAnimatorSliderView* slider_view_; // Weak reference. | 80 OverscrollAnimatorSliderView* slider_view_; // Weak reference. |
| 81 }; | 81 }; |
| 82 } // namespace overscroll_animator | 82 } // namespace overscroll_animator |
| 83 | 83 |
| 84 // OverscrollAnimatorSliderView Implementation --------------------------------- | 84 // OverscrollAnimatorSliderView Implementation --------------------------------- |
| 85 | 85 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 [self reset]; | 250 [self reset]; |
| 251 }]; | 251 }]; |
| 252 | 252 |
| 253 // Animate the moving view to its initial position. | 253 // Animate the moving view to its initial position. |
| 254 [[view animator] setFrameOrigin:[self frameOriginWithProgress:kMinProgress]]; | 254 [[view animator] setFrameOrigin:[self frameOriginWithProgress:kMinProgress]]; |
| 255 | 255 |
| 256 [NSAnimationContext endGrouping]; | 256 [NSAnimationContext endGrouping]; |
| 257 } | 257 } |
| 258 | 258 |
| 259 @end | 259 @end |
| OLD | NEW |