| 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 #ifndef CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_PREVIEWABLE_CONTENTS_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_PREVIEWABLE_CONTENTS_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_PREVIEWABLE_CONTENTS_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_PREVIEWABLE_CONTENTS_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // The desired height of the preview and units. | 44 // The desired height of the preview and units. |
| 45 CGFloat previewHeight_; | 45 CGFloat previewHeight_; |
| 46 InstantSizeUnits previewHeightUnits_; | 46 InstantSizeUnits previewHeightUnits_; |
| 47 | 47 |
| 48 // If true then a shadow is drawn below the preview. This is used to make | 48 // If true then a shadow is drawn below the preview. This is used to make |
| 49 // instant omnibox "float" over the tab's web contents. | 49 // instant omnibox "float" over the tab's web contents. |
| 50 BOOL drawDropShadow_; | 50 BOOL drawDropShadow_; |
| 51 | 51 |
| 52 // View responsible for drawing a drop shadow. | 52 // View responsible for drawing a drop shadow. |
| 53 scoped_nsobject<NSView> dropShadowView_; | 53 scoped_nsobject<NSView> dropShadowView_; |
| 54 |
| 55 BrowserWindowController* windowController_; |
| 56 |
| 57 // The vertical offset between the top of the view and the preview contents. |
| 58 // This is used to push the preview contents below the bookmark bar. Normally |
| 59 // this is 0 so that the preview contents obscures the bookmark bar. |
| 60 CGFloat previewOffset_; |
| 61 |
| 62 // The vertical offset between the top of the view and the active container. |
| 63 // This is used to push the active container below the bookmark bar. Normally |
| 64 // this is set to the height of the bookmark bar so that the bookmark bar is |
| 65 // not obscured. |
| 66 CGFloat activeContainerOffset_; |
| 54 } | 67 } |
| 55 | 68 |
| 56 @property(readonly, nonatomic) NSView* activeContainer; | 69 @property(readonly, nonatomic) NSView* activeContainer; |
| 57 @property(readonly, nonatomic) NSView* dropShadowView; | 70 @property(readonly, nonatomic) NSView* dropShadowView; |
| 58 @property(readonly, nonatomic) BOOL drawDropShadow; | 71 @property(readonly, nonatomic) BOOL drawDropShadow; |
| 72 @property(assign, nonatomic) CGFloat previewOffset; |
| 73 @property(assign, nonatomic) CGFloat activeContainerOffset; |
| 59 | 74 |
| 60 // Initialization. | 75 // Initialization. |
| 61 - (id)initWithBrowser:(Browser*)browser | 76 - (id)initWithBrowser:(Browser*)browser |
| 62 windowController:(BrowserWindowController*)windowController; | 77 windowController:(BrowserWindowController*)windowController; |
| 63 | 78 |
| 64 // Sets the current preview and installs its WebContentsView into the view | 79 // Sets the current preview and installs its WebContentsView into the view |
| 65 // hierarchy. Hides the active view. |preview| must not be NULL. | 80 // hierarchy. Hides the active view. |preview| must not be NULL. |
| 66 - (void)showPreview:(content::WebContents*)preview | 81 - (void)showPreview:(content::WebContents*)preview |
| 67 height:(CGFloat)height | 82 height:(CGFloat)height |
| 68 heightUnits:(InstantSizeUnits)heightUnits | 83 heightUnits:(InstantSizeUnits)heightUnits |
| 69 drawDropShadow:(BOOL)drawDropShadow; | 84 drawDropShadow:(BOOL)drawDropShadow; |
| 70 | 85 |
| 71 // Closes the current preview and shows the active view. | 86 // Closes the current preview and shows the active view. |
| 72 - (void)hidePreview; | 87 - (void)hidePreview; |
| 73 | 88 |
| 74 // Called when a tab with |contents| is activated, so that we can check to see | 89 // Called when a tab with |contents| is activated, so that we can check to see |
| 75 // if it's the preview being activated (and adjust internal state accordingly). | 90 // if it's the preview being activated (and adjust internal state accordingly). |
| 76 - (void)onActivateTabWithContents:(content::WebContents*)contents; | 91 - (void)onActivateTabWithContents:(content::WebContents*)contents; |
| 77 | 92 |
| 93 // Returns YES if the preview contents is currently showing. |
| 94 - (BOOL)isShowingPreview; |
| 95 |
| 78 - (InstantPreviewControllerMac*)instantPreviewController; | 96 - (InstantPreviewControllerMac*)instantPreviewController; |
| 79 | 97 |
| 80 @end | 98 @end |
| 81 | 99 |
| 82 #endif // CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_PREVIEWABLE_CONTENTS_CONTROLLER_
H_ | 100 #endif // CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_PREVIEWABLE_CONTENTS_CONTROLLER_
H_ |
| OLD | NEW |