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