| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_UI_COCOA_FAST_RESIZE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_FAST_RESIZE_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_FAST_RESIZE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_COCOA_FAST_RESIZE_VIEW_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 // A Cocoa view that supports an alternate resizing mode, normally used when | 10 // A Cocoa view that supports an alternate resizing mode, normally used when |
| 11 // animations are in progress. In normal resizing mode, subviews are sized to | 11 // animations are in progress. In normal resizing mode, subviews are sized to |
| 12 // completely fill this view's bounds. In fast resizing mode, the subviews' | 12 // completely fill this view's bounds. In fast resizing mode, the subviews' |
| 13 // size is not changed and the subview is clipped to fit, if necessary. Fast | 13 // size is not changed and the subview is clipped to fit, if necessary. Fast |
| 14 // resize mode is useful when animating a view that normally takes a significant | 14 // resize mode is useful when animating a view that normally takes a significant |
| 15 // amount of time to relayout and redraw when its size is changed. | 15 // amount of time to relayout and redraw when its size is changed. |
| 16 @interface FastResizeView : NSView { | 16 @interface FastResizeView : NSView { |
| 17 @private | 17 @private |
| 18 BOOL fastResizeMode_; | 18 BOOL fastResizeMode_; |
| 19 | |
| 20 // Offset from the top of the view where the view's content starts. This is | |
| 21 // used to prevent this view from drawing white on non-content area. | |
| 22 CGFloat contentOffset_; | |
| 23 } | 19 } |
| 24 | 20 |
| 25 @property(assign, nonatomic) CGFloat contentOffset; | |
| 26 | |
| 27 // Turns fast resizing mode on or off, which determines how this view resizes | 21 // Turns fast resizing mode on or off, which determines how this view resizes |
| 28 // its subviews. Turning fast resizing mode off has the effect of immediately | 22 // its subviews. Turning fast resizing mode off has the effect of immediately |
| 29 // resizing subviews to fit; callers do not need to explictly call |setFrame:| | 23 // resizing subviews to fit; callers do not need to explictly call |setFrame:| |
| 30 // to trigger a resize. | 24 // to trigger a resize. |
| 31 - (void)setFastResizeMode:(BOOL)fastResizeMode; | 25 - (void)setFastResizeMode:(BOOL)fastResizeMode; |
| 26 |
| 32 @end | 27 @end |
| 33 | 28 |
| 34 #endif // CHROME_BROWSER_UI_COCOA_FAST_RESIZE_VIEW_H_ | 29 #endif // CHROME_BROWSER_UI_COCOA_FAST_RESIZE_VIEW_H_ |
| OLD | NEW |