| 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_COCOA_BROWSER_WINDOW_CONTROLLER_PRIVATE_H_ | 5 #ifndef CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_PRIVATE_H_ | 
| 6 #define CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_PRIVATE_H_ | 6 #define CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_PRIVATE_H_ | 
| 7 | 7 | 
| 8 #import "chrome/browser/cocoa/browser_window_controller.h" | 8 #import "chrome/browser/cocoa/browser_window_controller.h" | 
| 9 | 9 | 
| 10 | 10 | 
| 11 // Private methods for the |BrowserWindowController|. This category should | 11 // Private methods for the |BrowserWindowController|. This category should | 
| 12 // contain the private methods used by different parts of the BWC; private | 12 // contain the private methods used by different parts of the BWC; private | 
| 13 // methods used only by single parts should be declared in their own file. | 13 // methods used only by single parts should be declared in their own file. | 
| 14 // TODO(viettrungluu): [crbug.com/35543] work on splitting out stuff from the | 14 // TODO(viettrungluu): [crbug.com/35543] work on splitting out stuff from the | 
| 15 // BWC, and figuring out which methods belong here (need to unravel | 15 // BWC, and figuring out which methods belong here (need to unravel | 
| 16 // "dependencies"). | 16 // "dependencies"). | 
| 17 @interface BrowserWindowController(Private) | 17 @interface BrowserWindowController(Private) | 
| 18 | 18 | 
|  | 19 // Returns YES if vertical tabs are enabled for this browser. | 
|  | 20 - (BOOL)useVerticalTabs; | 
|  | 21 | 
| 19 // Saves the window's position in the local state preferences. | 22 // Saves the window's position in the local state preferences. | 
| 20 - (void)saveWindowPositionIfNeeded; | 23 - (void)saveWindowPositionIfNeeded; | 
| 21 | 24 | 
| 22 // Saves the window's position to the given pref service. | 25 // Saves the window's position to the given pref service. | 
| 23 - (void)saveWindowPositionToPrefs:(PrefService*)prefs; | 26 - (void)saveWindowPositionToPrefs:(PrefService*)prefs; | 
| 24 | 27 | 
| 25 // We need to adjust where sheets come out of the window, as by default they | 28 // We need to adjust where sheets come out of the window, as by default they | 
| 26 // erupt from the omnibox, which is rather weird. | 29 // erupt from the omnibox, which is rather weird. | 
| 27 - (NSRect)window:(NSWindow*)window | 30 - (NSRect)window:(NSWindow*)window | 
| 28     willPositionSheet:(NSWindow*)sheet | 31     willPositionSheet:(NSWindow*)sheet | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
| 51 | 54 | 
| 52 // Returns YES if the bookmark bar should be placed below the infobar, NO | 55 // Returns YES if the bookmark bar should be placed below the infobar, NO | 
| 53 // otherwise. | 56 // otherwise. | 
| 54 - (BOOL)placeBookmarkBarBelowInfoBar; | 57 - (BOOL)placeBookmarkBarBelowInfoBar; | 
| 55 | 58 | 
| 56 // Lays out the bookmark bar at the given maximum y-coordinate, with the given | 59 // Lays out the bookmark bar at the given maximum y-coordinate, with the given | 
| 57 // width; returns the new maximum y (below the bookmark bar). Note that one must | 60 // width; returns the new maximum y (below the bookmark bar). Note that one must | 
| 58 // call it with the appropriate |maxY| which depends on whether or not the | 61 // call it with the appropriate |maxY| which depends on whether or not the | 
| 59 // bookmark bar is shown as the NTP bubble or not (use | 62 // bookmark bar is shown as the NTP bubble or not (use | 
| 60 // |-placeBookmarkBarBelowInfoBar|). | 63 // |-placeBookmarkBarBelowInfoBar|). | 
| 61 - (CGFloat)layoutBookmarkBarAtMaxY:(CGFloat)maxY width:(CGFloat)width; | 64 - (CGFloat)layoutBookmarkBarAtMinX:(CGFloat)minX | 
|  | 65                               maxY:(CGFloat)maxY | 
|  | 66                              width:(CGFloat)width; | 
| 62 | 67 | 
| 63 // Lay out the view which draws the background for the floating bar when in | 68 // Lay out the view which draws the background for the floating bar when in | 
| 64 // fullscreen mode, with the given (minimum) y-coordinate, width, height, and | 69 // fullscreen mode, with the given frame and fullscreen-mode-status. Should be | 
| 65 // fullscreen-mode-status. Should be called even when not in fullscreen mode to | 70 // called even when not in fullscreen mode to hide the backing view. | 
| 66 // hide the backing view. | 71 - (void)layoutFloatingBarBackingView:(NSRect)frame | 
| 67 - (void)layoutFloatingBarBackingViewAtY:(CGFloat)y | 72                           fullscreen:(BOOL)fullscreen; | 
| 68                                   width:(CGFloat)width |  | 
| 69                                  height:(CGFloat)height |  | 
| 70                              fullscreen:(BOOL)fullscreen; |  | 
| 71 | 73 | 
| 72 // Lays out the infobar at the given maximum y-coordinate, with the given width; | 74 // Lays out the infobar at the given maximum y-coordinate, with the given width; | 
| 73 // returns the new maximum y (below the infobar). | 75 // returns the new maximum y (below the infobar). | 
| 74 - (CGFloat)layoutInfoBarAtMaxY:(CGFloat)maxY width:(CGFloat)width; | 76 - (CGFloat)layoutInfoBarAtMinX:(CGFloat)minX | 
|  | 77                           maxY:(CGFloat)maxY | 
|  | 78                          width:(CGFloat)width; | 
| 75 | 79 | 
| 76 // Lays out the download shelf, if there is one, at the given minimum | 80 // Lays out the download shelf, if there is one, at the given minimum | 
| 77 // y-coordinate, with the given width; returns the new minimum y (above the | 81 // y-coordinate, with the given width; returns the new minimum y (above the | 
| 78 // download shelf). This is safe to call even if there is no download shelf. | 82 // download shelf). This is safe to call even if there is no download shelf. | 
| 79 - (CGFloat)layoutDownloadShelfAtMinY:(CGFloat)minY width:(CGFloat)width; | 83 - (CGFloat)layoutDownloadShelfAtMinX:(CGFloat)minX | 
|  | 84                                 minY:(CGFloat)minY | 
|  | 85                                width:(CGFloat)width; | 
| 80 | 86 | 
| 81 // Lays out the tab content area between the given minimum and maximum | 87 // Lays out the tab content area in the given frame. If the height changes, | 
| 82 // y-coordinates, with the given width. | 88 // sends a message to the renderer to resize. | 
| 83 - (void)layoutTabContentAreaAtMinY:(CGFloat)minY | 89 - (void)layoutTabContentArea:(NSRect)frame; | 
| 84                               maxY:(CGFloat)maxY |  | 
| 85                              width:(CGFloat)width; |  | 
| 86 | 90 | 
| 87 // Should we show the normal bookmark bar? | 91 // Should we show the normal bookmark bar? | 
| 88 - (BOOL)shouldShowBookmarkBar; | 92 - (BOOL)shouldShowBookmarkBar; | 
| 89 | 93 | 
| 90 // Is the current page one for which the bookmark should be shown detached *if* | 94 // Is the current page one for which the bookmark should be shown detached *if* | 
| 91 // the normal bookmark bar is not shown? | 95 // the normal bookmark bar is not shown? | 
| 92 - (BOOL)shouldShowDetachedBookmarkBar; | 96 - (BOOL)shouldShowDetachedBookmarkBar; | 
| 93 | 97 | 
| 94 // Sets the toolbar's height to a value appropriate for the given compression. | 98 // Sets the toolbar's height to a value appropriate for the given compression. | 
| 95 // Also adjusts the bookmark bar's height by the opposite amount in order to | 99 // Also adjusts the bookmark bar's height by the opposite amount in order to | 
| 96 // keep the total height of the two views constant. | 100 // keep the total height of the two views constant. | 
| 97 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression; | 101 - (void)adjustToolbarAndBookmarkBarForCompression:(CGFloat)compression; | 
| 98 | 102 | 
| 99 // Adjust the UI when entering or leaving fullscreen mode. | 103 // Adjust the UI when entering or leaving fullscreen mode. | 
| 100 - (void)adjustUIForFullscreen:(BOOL)fullscreen; | 104 - (void)adjustUIForFullscreen:(BOOL)fullscreen; | 
| 101 | 105 | 
| 102 // Allows/prevents bar visibility locks and releases from updating the visual | 106 // Allows/prevents bar visibility locks and releases from updating the visual | 
| 103 // state. Enabling makes changes instantaneously; disabling cancels any | 107 // state. Enabling makes changes instantaneously; disabling cancels any | 
| 104 // timers/animation. | 108 // timers/animation. | 
| 105 - (void)enableBarVisibilityUpdates; | 109 - (void)enableBarVisibilityUpdates; | 
| 106 - (void)disableBarVisibilityUpdates; | 110 - (void)disableBarVisibilityUpdates; | 
| 107 | 111 | 
|  | 112 // Removes existing toolbar and re-creates the appropriate toolbar controller | 
|  | 113 // based on if vertical tabs are enabled. | 
|  | 114 - (void)initializeToolbarWithBrowser:(Browser*)browser; | 
|  | 115 | 
| 108 @end  // @interface BrowserWindowController(Private) | 116 @end  // @interface BrowserWindowController(Private) | 
| 109 | 117 | 
| 110 | 118 | 
| 111 #endif  // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_PRIVATE_H_ | 119 #endif  // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_PRIVATE_H_ | 
| OLD | NEW | 
|---|