| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "ios/chrome/browser/ui/ntp/centering_scrollview.h" | 5 #import "ios/chrome/browser/ui/ntp/centering_scrollview.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ios/chrome/browser/ui/ui_util.h" | 8 #include "ios/chrome/browser/ui/ui_util.h" |
| 9 | 9 |
| 10 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 11 #error "This file requires ARC support." |
| 12 #endif |
| 13 |
| 10 namespace { | 14 namespace { |
| 11 // Thickness of scrollbar images inserted by UIScrollView (circa iOS 5.0). | 15 // Thickness of scrollbar images inserted by UIScrollView (circa iOS 5.0). |
| 12 const CGFloat kScrollBarThickness = 7.0; | 16 const CGFloat kScrollBarThickness = 7.0; |
| 13 } // namespace | 17 } // namespace |
| 14 | 18 |
| 15 @interface CenteringScrollView () | 19 @interface CenteringScrollView () |
| 16 // Returns the one and only subview. There may be other subviews | 20 // Returns the one and only subview. There may be other subviews |
| 17 // (e.g. UIImageView for the scrollbars) created by UIScrollView. | 21 // (e.g. UIImageView for the scrollbars) created by UIScrollView. |
| 18 - (UIView*)findContentView; | 22 - (UIView*)findContentView; |
| 19 @end | 23 @end |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 thickness <= kScrollBarThickness) | 71 thickness <= kScrollBarThickness) |
| 68 continue; | 72 continue; |
| 69 soloView = view; | 73 soloView = view; |
| 70 ++viewCount; | 74 ++viewCount; |
| 71 } | 75 } |
| 72 DCHECK(viewCount == 1); | 76 DCHECK(viewCount == 1); |
| 73 return soloView; | 77 return soloView; |
| 74 } | 78 } |
| 75 | 79 |
| 76 @end | 80 @end |
| OLD | NEW |