| 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 12 matching lines...) Expand all Loading... |
| 23 class Browser; | 23 class Browser; |
| 24 class BrowserWindow; | 24 class BrowserWindow; |
| 25 class BrowserWindowCocoa; | 25 class BrowserWindowCocoa; |
| 26 class ConstrainedWindowMac; | 26 class ConstrainedWindowMac; |
| 27 @class DownloadShelfController; | 27 @class DownloadShelfController; |
| 28 @class ExtensionShelfController; | 28 @class ExtensionShelfController; |
| 29 @class FindBarCocoaController; | 29 @class FindBarCocoaController; |
| 30 @class GTMWindowSheetController; | 30 @class GTMWindowSheetController; |
| 31 @class InfoBarContainerController; | 31 @class InfoBarContainerController; |
| 32 class LocationBar; | 32 class LocationBar; |
| 33 class StatusBubble; | 33 class StatusBubbleMac; |
| 34 class TabContents; | 34 class TabContents; |
| 35 @class TabContentsController; | 35 @class TabContentsController; |
| 36 @class TabStripController; | 36 @class TabStripController; |
| 37 class TabStripModelObserverBridge; | 37 class TabStripModelObserverBridge; |
| 38 @class TabStripView; | 38 @class TabStripView; |
| 39 @class ToolbarController; | 39 @class ToolbarController; |
| 40 @class TitlebarController; | 40 @class TitlebarController; |
| 41 | 41 |
| 42 @interface BrowserWindowController : | 42 @interface BrowserWindowController : |
| 43 TabWindowController<NSUserInterfaceValidations, | 43 TabWindowController<NSUserInterfaceValidations, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 57 scoped_ptr<Browser> browser_; | 57 scoped_ptr<Browser> browser_; |
| 58 scoped_nsobject<NSWindow> window_; | 58 scoped_nsobject<NSWindow> window_; |
| 59 scoped_nsobject<NSWindow> fullscreen_window_; | 59 scoped_nsobject<NSWindow> fullscreen_window_; |
| 60 scoped_ptr<TabStripModelObserverBridge> tabObserver_; | 60 scoped_ptr<TabStripModelObserverBridge> tabObserver_; |
| 61 scoped_ptr<BrowserWindowCocoa> windowShim_; | 61 scoped_ptr<BrowserWindowCocoa> windowShim_; |
| 62 scoped_nsobject<ToolbarController> toolbarController_; | 62 scoped_nsobject<ToolbarController> toolbarController_; |
| 63 scoped_nsobject<TitlebarController> titlebarController_; | 63 scoped_nsobject<TitlebarController> titlebarController_; |
| 64 scoped_nsobject<TabStripController> tabStripController_; | 64 scoped_nsobject<TabStripController> tabStripController_; |
| 65 scoped_nsobject<FindBarCocoaController> findBarCocoaController_; | 65 scoped_nsobject<FindBarCocoaController> findBarCocoaController_; |
| 66 scoped_nsobject<InfoBarContainerController> infoBarContainerController_; | 66 scoped_nsobject<InfoBarContainerController> infoBarContainerController_; |
| 67 scoped_ptr<StatusBubble> statusBubble_; | 67 scoped_ptr<StatusBubbleMac> statusBubble_; |
| 68 scoped_nsobject<DownloadShelfController> downloadShelfController_; | 68 scoped_nsobject<DownloadShelfController> downloadShelfController_; |
| 69 scoped_nsobject<ExtensionShelfController> extensionShelfController_; | 69 scoped_nsobject<ExtensionShelfController> extensionShelfController_; |
| 70 scoped_nsobject<BookmarkBarController> bookmarkBarController_; | 70 scoped_nsobject<BookmarkBarController> bookmarkBarController_; |
| 71 scoped_nsobject<BookmarkBubbleController> bookmarkBubbleController_; | 71 scoped_nsobject<BookmarkBubbleController> bookmarkBubbleController_; |
| 72 scoped_nsobject<GTMTheme> theme_; | 72 scoped_nsobject<GTMTheme> theme_; |
| 73 BOOL ownsBrowser_; // Only ever NO when testing | 73 BOOL ownsBrowser_; // Only ever NO when testing |
| 74 BOOL fullscreen_; | 74 BOOL fullscreen_; |
| 75 CGFloat verticalOffsetForStatusBubble_; | 75 CGFloat verticalOffsetForStatusBubble_; |
| 76 } | 76 } |
| 77 | 77 |
| 78 // Load the browser window nib and do any Cocoa-specific initialization. | 78 // Load the browser window nib and do any Cocoa-specific initialization. |
| 79 // Takes ownership of |browser|. | 79 // Takes ownership of |browser|. |
| 80 - (id)initWithBrowser:(Browser*)browser; | 80 - (id)initWithBrowser:(Browser*)browser; |
| 81 | 81 |
| 82 // Call to make the browser go away from other places in the cross-platform | 82 // Call to make the browser go away from other places in the cross-platform |
| 83 // code. | 83 // code. |
| 84 - (void)destroyBrowser; | 84 - (void)destroyBrowser; |
| 85 | 85 |
| 86 // Access the C++ bridge between the NSWindow and the rest of Chromium. | 86 // Access the C++ bridge between the NSWindow and the rest of Chromium. |
| 87 - (BrowserWindow*)browserWindow; | 87 - (BrowserWindow*)browserWindow; |
| 88 | 88 |
| 89 // Access the C++ bridge object representing the location bar. | 89 // Access the C++ bridge object representing the location bar. |
| 90 - (LocationBar*)locationBar; | 90 - (LocationBar*)locationBar; |
| 91 | 91 |
| 92 // Access the C++ bridge object representing the status bubble for the window. | 92 // Access the C++ bridge object representing the status bubble for the window. |
| 93 - (StatusBubble*)statusBubble; | 93 - (StatusBubbleMac*)statusBubble; |
| 94 | 94 |
| 95 // Updates the toolbar (and transitively the location bar) with the states of | 95 // Updates the toolbar (and transitively the location bar) with the states of |
| 96 // the specified |tab|. If |shouldRestore| is true, we're switching | 96 // the specified |tab|. If |shouldRestore| is true, we're switching |
| 97 // (back?) to this tab and should restore any previous location bar state | 97 // (back?) to this tab and should restore any previous location bar state |
| 98 // (such as user editing) as well. | 98 // (such as user editing) as well. |
| 99 - (void)updateToolbarWithContents:(TabContents*)tab | 99 - (void)updateToolbarWithContents:(TabContents*)tab |
| 100 shouldRestoreState:(BOOL)shouldRestore; | 100 shouldRestoreState:(BOOL)shouldRestore; |
| 101 | 101 |
| 102 // Sets whether or not the current page in the frontmost tab is bookmarked. | 102 // Sets whether or not the current page in the frontmost tab is bookmarked. |
| 103 - (void)setStarredState:(BOOL)isStarred; | 103 - (void)setStarredState:(BOOL)isStarred; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 - (void)showBookmarkBubbleForURL:(const GURL&)url | 148 - (void)showBookmarkBubbleForURL:(const GURL&)url |
| 149 alreadyBookmarked:(BOOL)alreadyBookmarked; | 149 alreadyBookmarked:(BOOL)alreadyBookmarked; |
| 150 | 150 |
| 151 // Returns the (lazily created) window sheet controller of this window. Used | 151 // Returns the (lazily created) window sheet controller of this window. Used |
| 152 // for the per-tab sheets. | 152 // for the per-tab sheets. |
| 153 - (GTMWindowSheetController*)sheetController; | 153 - (GTMWindowSheetController*)sheetController; |
| 154 | 154 |
| 155 - (void)attachConstrainedWindow:(ConstrainedWindowMac*)window; | 155 - (void)attachConstrainedWindow:(ConstrainedWindowMac*)window; |
| 156 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window; | 156 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window; |
| 157 | 157 |
| 158 // Delegate method called when window is resized. |
| 159 - (void)windowDidResize:(NSNotification*)notification; |
| 160 |
| 158 @end | 161 @end |
| 159 | 162 |
| 160 | 163 |
| 161 @interface BrowserWindowController(TestingAPI) | 164 @interface BrowserWindowController(TestingAPI) |
| 162 | 165 |
| 163 // Put the incognito badge on the browser and adjust the tab strip | 166 // Put the incognito badge on the browser and adjust the tab strip |
| 164 // accordingly. | 167 // accordingly. |
| 165 - (void)installIncognitoBadge; | 168 - (void)installIncognitoBadge; |
| 166 | 169 |
| 167 // Allows us to initWithBrowser withOUT taking ownership of the browser. | 170 // Allows us to initWithBrowser withOUT taking ownership of the browser. |
| 168 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt; | 171 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt; |
| 169 | 172 |
| 170 // Return an autoreleased NSWindow suitable for fullscreen use. | 173 // Return an autoreleased NSWindow suitable for fullscreen use. |
| 171 - (NSWindow*)fullscreenWindow; | 174 - (NSWindow*)fullscreenWindow; |
| 172 | 175 |
| 173 // Return a point suitable for the topLeft for a bookmark bubble. | 176 // Return a point suitable for the topLeft for a bookmark bubble. |
| 174 - (NSPoint)topLeftForBubble; | 177 - (NSPoint)topLeftForBubble; |
| 175 | 178 |
| 176 @end // BrowserWindowController(TestingAPI) | 179 @end // BrowserWindowController(TestingAPI) |
| 177 | 180 |
| 178 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 181 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
| OLD | NEW |