| 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 13 matching lines...) Expand all Loading... |
| 24 @class DownloadShelfController; | 24 @class DownloadShelfController; |
| 25 @class FindBarCocoaController; | 25 @class FindBarCocoaController; |
| 26 class LocationBar; | 26 class LocationBar; |
| 27 class StatusBubble; | 27 class StatusBubble; |
| 28 class TabContents; | 28 class TabContents; |
| 29 @class TabContentsController; | 29 @class TabContentsController; |
| 30 @class TabStripController; | 30 @class TabStripController; |
| 31 class TabStripModelObserverBridge; | 31 class TabStripModelObserverBridge; |
| 32 @class TabStripView; | 32 @class TabStripView; |
| 33 @class ToolbarController; | 33 @class ToolbarController; |
| 34 @class TitlebarController; |
| 34 | 35 |
| 35 @interface BrowserWindowController : | 36 @interface BrowserWindowController : |
| 36 TabWindowController<NSUserInterfaceValidations, | 37 TabWindowController<NSUserInterfaceValidations, |
| 37 BookmarkURLOpener, | 38 BookmarkURLOpener, |
| 38 GTMThemeDelegate> { | 39 GTMThemeDelegate> { |
| 39 @private | 40 @private |
| 40 // The ordering of these members is important as it determines the order in | 41 // The ordering of these members is important as it determines the order in |
| 41 // which they are destroyed. |browser_| needs to be destroyed last as most of | 42 // which they are destroyed. |browser_| needs to be destroyed last as most of |
| 42 // the other objects hold weak references to it or things it owns | 43 // the other objects hold weak references to it or things it owns |
| 43 // (tab/toolbar/bookmark models, profiles, etc). We hold a strong ref to the | 44 // (tab/toolbar/bookmark models, profiles, etc). We hold a strong ref to the |
| 44 // window so that it will live after the NSWindowController dealloc has run | 45 // window so that it will live after the NSWindowController dealloc has run |
| 45 // (which happens *before* these scoped pointers are torn down). Keeping it | 46 // (which happens *before* these scoped pointers are torn down). Keeping it |
| 46 // alive ensures that weak view or window pointers remain valid through | 47 // alive ensures that weak view or window pointers remain valid through |
| 47 // their destruction sequence. | 48 // their destruction sequence. |
| 48 scoped_ptr<Browser> browser_; | 49 scoped_ptr<Browser> browser_; |
| 49 scoped_nsobject<NSWindow> window_; | 50 scoped_nsobject<NSWindow> window_; |
| 50 scoped_nsobject<NSWindow> fullscreen_window_; | 51 scoped_nsobject<NSWindow> fullscreen_window_; |
| 51 scoped_ptr<TabStripModelObserverBridge> tabObserver_; | 52 scoped_ptr<TabStripModelObserverBridge> tabObserver_; |
| 52 scoped_ptr<BrowserWindowCocoa> windowShim_; | 53 scoped_ptr<BrowserWindowCocoa> windowShim_; |
| 53 scoped_nsobject<ToolbarController> toolbarController_; | 54 scoped_nsobject<ToolbarController> toolbarController_; |
| 55 scoped_nsobject<TitlebarController> titlebarController_; |
| 54 scoped_nsobject<TabStripController> tabStripController_; | 56 scoped_nsobject<TabStripController> tabStripController_; |
| 55 scoped_nsobject<FindBarCocoaController> findBarCocoaController_; | 57 scoped_nsobject<FindBarCocoaController> findBarCocoaController_; |
| 56 scoped_ptr<StatusBubble> statusBubble_; | 58 scoped_ptr<StatusBubble> statusBubble_; |
| 57 scoped_nsobject<DownloadShelfController> downloadShelfController_; | 59 scoped_nsobject<DownloadShelfController> downloadShelfController_; |
| 58 scoped_nsobject<GTMTheme> theme_; | 60 scoped_nsobject<GTMTheme> theme_; |
| 59 BOOL ownsBrowser_; // Only ever NO when testing | 61 BOOL ownsBrowser_; // Only ever NO when testing |
| 60 BOOL fullscreen_; | 62 BOOL fullscreen_; |
| 61 } | 63 } |
| 62 | 64 |
| 63 // Load the browser window nib and do any Cocoa-specific initialization. | 65 // Load the browser window nib and do any Cocoa-specific initialization. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 137 |
| 136 // Allows us to initWithBrowser withOUT taking ownership of the browser. | 138 // Allows us to initWithBrowser withOUT taking ownership of the browser. |
| 137 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt; | 139 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt; |
| 138 | 140 |
| 139 // Return an autoreleased NSWindow suitable for fullscreen use. | 141 // Return an autoreleased NSWindow suitable for fullscreen use. |
| 140 - (NSWindow*)fullscreenWindow; | 142 - (NSWindow*)fullscreenWindow; |
| 141 | 143 |
| 142 @end // BrowserWindowController(TestingAPI) | 144 @end // BrowserWindowController(TestingAPI) |
| 143 | 145 |
| 144 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 146 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
| OLD | NEW |