| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_EXTENSIONS_BROWSER_ACTIONS_CONTAINER_VIEW_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTIONS_CONTAINER_VIEW_ |
| 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTIONS_CONTAINER_VIEW_ | 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTIONS_CONTAINER_VIEW_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 // Sent when a user-initiated drag to resize the container is initiated. | 10 // Sent when a user-initiated drag to resize the container is initiated. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // Key which is used to notify the translation with delta. | 25 // Key which is used to notify the translation with delta. |
| 26 extern NSString* const kTranslationWithDelta; | 26 extern NSString* const kTranslationWithDelta; |
| 27 | 27 |
| 28 // The view that encompasses the Browser Action buttons in the toolbar and | 28 // The view that encompasses the Browser Action buttons in the toolbar and |
| 29 // provides mechanisms for resizing. | 29 // provides mechanisms for resizing. |
| 30 @interface BrowserActionsContainerView : NSView { | 30 @interface BrowserActionsContainerView : NSView { |
| 31 @private | 31 @private |
| 32 // The frame encompasing the grippy used for resizing the container. | 32 // The frame encompasing the grippy used for resizing the container. |
| 33 NSRect grippyRect_; | 33 NSRect grippyRect_; |
| 34 | 34 |
| 35 // The end frame of the animation currently running for this container or | |
| 36 // NSZeroRect if none is in progress. | |
| 37 NSRect animationEndFrame_; | |
| 38 | |
| 39 // Used to cache the original position within the container that initiated the | 35 // Used to cache the original position within the container that initiated the |
| 40 // drag. | 36 // drag. |
| 41 NSPoint initialDragPoint_; | 37 NSPoint initialDragPoint_; |
| 42 | 38 |
| 43 // Used to cache the previous x-pos of the frame rect for resizing purposes. | 39 // Used to cache the previous x-pos of the frame rect for resizing purposes. |
| 44 CGFloat lastXPos_; | 40 CGFloat lastXPos_; |
| 45 | 41 |
| 46 // The maximum width of the container. | 42 // The maximum width of the container. |
| 47 CGFloat maxWidth_; | 43 CGFloat maxWidth_; |
| 48 | 44 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 72 | 68 |
| 73 // Resizes the container to the given ideal width, adjusting the |lastXPos_| so | 69 // Resizes the container to the given ideal width, adjusting the |lastXPos_| so |
| 74 // that |resizeDeltaX| is accurate. | 70 // that |resizeDeltaX| is accurate. |
| 75 - (void)resizeToWidth:(CGFloat)width animate:(BOOL)animate; | 71 - (void)resizeToWidth:(CGFloat)width animate:(BOOL)animate; |
| 76 | 72 |
| 77 // Returns the change in the x-pos of the frame rect during resizing. Meant to | 73 // Returns the change in the x-pos of the frame rect during resizing. Meant to |
| 78 // be queried when a NSViewFrameDidChangeNotification is fired to determine | 74 // be queried when a NSViewFrameDidChangeNotification is fired to determine |
| 79 // placement of surrounding elements. | 75 // placement of surrounding elements. |
| 80 - (CGFloat)resizeDeltaX; | 76 - (CGFloat)resizeDeltaX; |
| 81 | 77 |
| 82 @property(nonatomic, readonly) NSRect animationEndFrame; | 78 // Returns the frame of the container after the running animation has finished. |
| 79 // If no animation is running, returns the container's current frame. |
| 80 - (NSRect)animationEndFrame; |
| 81 |
| 83 @property(nonatomic) BOOL canDragLeft; | 82 @property(nonatomic) BOOL canDragLeft; |
| 84 @property(nonatomic) BOOL canDragRight; | 83 @property(nonatomic) BOOL canDragRight; |
| 85 @property(nonatomic) BOOL grippyPinned; | 84 @property(nonatomic) BOOL grippyPinned; |
| 86 @property(nonatomic,getter=isResizable) BOOL resizable; | 85 @property(nonatomic,getter=isResizable) BOOL resizable; |
| 87 @property(nonatomic) CGFloat maxWidth; | 86 @property(nonatomic) CGFloat maxWidth; |
| 88 @property(readonly, nonatomic) BOOL userIsResizing; | 87 @property(readonly, nonatomic) BOOL userIsResizing; |
| 89 | 88 |
| 90 @end | 89 @end |
| 91 | 90 |
| 92 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTIONS_CONTAINER_VIEW_ | 91 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTIONS_CONTAINER_VIEW_ |
| OLD | NEW |