| 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; | 10 @class CAShapeLayer; |
| 11 | 11 |
| 12 // A Cocoa view that supports an alternate resizing mode, normally used when | 12 // A Cocoa view originally created to support fast re-painting to white on |
| 13 // animations are in progress. In normal resizing mode, subviews are sized to | 13 // resize. This is done by CoreAnimation now, so this view remains only as the |
| 14 // completely fill this view's bounds. In fast resizing mode, the subviews' | 14 // first opaque ancestor of accelerated web contents views. |
| 15 // size is not changed and the subview is clipped to fit, if necessary. Fast | |
| 16 // resize mode is useful when animating a view that normally takes a significant | |
| 17 // amount of time to relayout and redraw when its size is changed. | |
| 18 @interface FastResizeView : NSView { | 15 @interface FastResizeView : NSView { |
| 19 @private | 16 @private |
| 20 BOOL fastResizeMode_; | |
| 21 | |
| 22 // Whether the bottom corners should be rounded. | 17 // Whether the bottom corners should be rounded. |
| 23 BOOL roundedBottomCorners_; | 18 BOOL roundedBottomCorners_; |
| 24 | 19 |
| 25 // Weak reference to the mask of the hosted layer. | 20 // Weak reference to the mask of the hosted layer. |
| 26 CAShapeLayer* layerMask_; | 21 CAShapeLayer* layerMask_; |
| 27 } | 22 } |
| 28 | 23 |
| 29 // Turns fast resizing mode on or off, which determines how this view resizes | |
| 30 // its subviews. Turning fast resizing mode off has the effect of immediately | |
| 31 // resizing subviews to fit; callers do not need to explictly call |setFrame:| | |
| 32 // to trigger a resize. | |
| 33 - (void)setFastResizeMode:(BOOL)fastResizeMode; | |
| 34 | |
| 35 // Changes whether the bottom two corners are rounded. | 24 // Changes whether the bottom two corners are rounded. |
| 36 - (void)setRoundedBottomCorners:(BOOL)roundedBottomCorners; | 25 - (void)setRoundedBottomCorners:(BOOL)roundedBottomCorners; |
| 37 | 26 |
| 38 @end | 27 @end |
| 39 | 28 |
| 40 #endif // CHROME_BROWSER_UI_COCOA_FAST_RESIZE_VIEW_H_ | 29 #endif // CHROME_BROWSER_UI_COCOA_FAST_RESIZE_VIEW_H_ |
| OLD | NEW |