| 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_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
| 7 | 7 |
| 8 // A class acting as the Objective-C controller for the Browser | 8 // A class acting as the Objective-C controller for the Browser |
| 9 // object. Handles interactions between Cocoa and the cross-platform | 9 // object. Handles interactions between Cocoa and the cross-platform |
| 10 // code. Each window has a single toolbar and, by virtue of being a | 10 // code. Each window has a single toolbar and, by virtue of being a |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // Strong. StatusBubble is a special case of a strong reference that | 70 // Strong. StatusBubble is a special case of a strong reference that |
| 71 // we don't wrap in a scoped_ptr because it is acting the same | 71 // we don't wrap in a scoped_ptr because it is acting the same |
| 72 // as an NSWindowController in that it wraps a window that must | 72 // as an NSWindowController in that it wraps a window that must |
| 73 // be shut down before our destructors are called. | 73 // be shut down before our destructors are called. |
| 74 StatusBubbleMac* statusBubble_; | 74 StatusBubbleMac* statusBubble_; |
| 75 | 75 |
| 76 // Strong. We don't wrap it in scoped_nsobject because we must close | 76 // Strong. We don't wrap it in scoped_nsobject because we must close |
| 77 // it appropriately in [windowWillClose:]. | 77 // it appropriately in [windowWillClose:]. |
| 78 BookmarkBubbleController* bookmarkBubbleController_; | 78 BookmarkBubbleController* bookmarkBubbleController_; |
| 79 scoped_nsobject<GTMTheme> theme_; | 79 scoped_nsobject<GTMTheme> theme_; |
| 80 BOOL initializing_; // YES while we are currently in initWithBrowser: |
| 80 BOOL ownsBrowser_; // Only ever NO when testing | 81 BOOL ownsBrowser_; // Only ever NO when testing |
| 81 CGFloat verticalOffsetForStatusBubble_; | 82 CGFloat verticalOffsetForStatusBubble_; |
| 82 } | 83 } |
| 83 | 84 |
| 84 // Load the browser window nib and do any Cocoa-specific initialization. | 85 // Load the browser window nib and do any Cocoa-specific initialization. |
| 85 // Takes ownership of |browser|. | 86 // Takes ownership of |browser|. |
| 86 - (id)initWithBrowser:(Browser*)browser; | 87 - (id)initWithBrowser:(Browser*)browser; |
| 87 | 88 |
| 88 // Call to make the browser go away from other places in the cross-platform | 89 // Call to make the browser go away from other places in the cross-platform |
| 89 // code. | 90 // code. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 182 |
| 182 @interface BrowserWindowController(TestingAPI) | 183 @interface BrowserWindowController(TestingAPI) |
| 183 | 184 |
| 184 // Put the incognito badge on the browser and adjust the tab strip | 185 // Put the incognito badge on the browser and adjust the tab strip |
| 185 // accordingly. | 186 // accordingly. |
| 186 - (void)installIncognitoBadge; | 187 - (void)installIncognitoBadge; |
| 187 | 188 |
| 188 // Allows us to initWithBrowser withOUT taking ownership of the browser. | 189 // Allows us to initWithBrowser withOUT taking ownership of the browser. |
| 189 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt; | 190 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt; |
| 190 | 191 |
| 192 // Adjusts the window height by the given amount. If the window spans from the |
| 193 // top of the current workspace to the bottom of the current workspace, the |
| 194 // height is not adjusted. If growing the window by the requested amount would |
| 195 // size the window to be taller than the current workspace, the window height is |
| 196 // capped to be equal to the height of the current workspace. If the window is |
| 197 // partially offscreen, its height is not adjusted at all. This function |
| 198 // prefers to grow the window down, but will grow up if needed. Calls to this |
| 199 // function should be followed by a call to |layoutSubviews|. |
| 200 - (void)adjustWindowHeightBy:(CGFloat)deltaH; |
| 201 |
| 191 // Return an autoreleased NSWindow suitable for fullscreen use. | 202 // Return an autoreleased NSWindow suitable for fullscreen use. |
| 192 - (NSWindow*)fullscreenWindow; | 203 - (NSWindow*)fullscreenWindow; |
| 193 | 204 |
| 194 // Return a point suitable for the topLeft for a bookmark bubble. | 205 // Return a point suitable for the topLeft for a bookmark bubble. |
| 195 - (NSPoint)topLeftForBubble; | 206 - (NSPoint)topLeftForBubble; |
| 196 | 207 |
| 197 // Updates a bookmark sync UI item (expected to be a menu item). This is | 208 // Updates a bookmark sync UI item (expected to be a menu item). This is |
| 198 // called every time the menu containing the sync UI item is displayed. | 209 // called every time the menu containing the sync UI item is displayed. |
| 199 - (void)updateSyncItem:(id)syncItem | 210 - (void)updateSyncItem:(id)syncItem |
| 200 syncEnabled:(BOOL)syncEnabled | 211 syncEnabled:(BOOL)syncEnabled |
| 201 status:(SyncStatusUIHelper::MessageType)status; | 212 status:(SyncStatusUIHelper::MessageType)status; |
| 202 | 213 |
| 203 @end // BrowserWindowController(TestingAPI) | 214 @end // BrowserWindowController(TestingAPI) |
| 204 | 215 |
| 205 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 216 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
| OLD | NEW |