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 @class CAShapeLayer; |
| 11 |
10 // A Cocoa view that supports an alternate resizing mode, normally used when | 12 // 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 | 13 // 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' | 14 // 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 | 15 // 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 | 16 // 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. | 17 // amount of time to relayout and redraw when its size is changed. |
16 @interface FastResizeView : NSView { | 18 @interface FastResizeView : NSView { |
17 @private | 19 @private |
18 BOOL fastResizeMode_; | 20 BOOL fastResizeMode_; |
| 21 |
| 22 // Whether the bottom corners should be rounded. |
| 23 BOOL roundedBottomCorners_; |
| 24 |
| 25 // Weak reference to the mask of the hosted layer. |
| 26 CAShapeLayer* layerMask_; |
19 } | 27 } |
20 | 28 |
21 // Turns fast resizing mode on or off, which determines how this view resizes | 29 // Turns fast resizing mode on or off, which determines how this view resizes |
22 // its subviews. Turning fast resizing mode off has the effect of immediately | 30 // its subviews. Turning fast resizing mode off has the effect of immediately |
23 // resizing subviews to fit; callers do not need to explictly call |setFrame:| | 31 // resizing subviews to fit; callers do not need to explictly call |setFrame:| |
24 // to trigger a resize. | 32 // to trigger a resize. |
25 - (void)setFastResizeMode:(BOOL)fastResizeMode; | 33 - (void)setFastResizeMode:(BOOL)fastResizeMode; |
26 | 34 |
| 35 // Changes whether the bottom two corners are rounded. |
| 36 - (void)setRoundedBottomCorners:(BOOL)roundedBottomCorners; |
| 37 |
27 @end | 38 @end |
28 | 39 |
29 #endif // CHROME_BROWSER_UI_COCOA_FAST_RESIZE_VIEW_H_ | 40 #endif // CHROME_BROWSER_UI_COCOA_FAST_RESIZE_VIEW_H_ |
OLD | NEW |