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 |
11 // TabWindowController, a tab strip along the top. | 11 // TabWindowController, a tab strip along the top. |
12 | 12 |
13 #import <Cocoa/Cocoa.h> | 13 #import <Cocoa/Cocoa.h> |
14 | 14 |
15 #include "base/scoped_nsobject.h" | 15 #include "base/scoped_nsobject.h" |
16 #include "base/scoped_ptr.h" | 16 #include "base/scoped_ptr.h" |
17 #import "chrome/browser/cocoa/tab_window_controller.h" | 17 #import "chrome/browser/cocoa/tab_window_controller.h" |
18 #import "chrome/browser/cocoa/bookmark_bar_controller.h" | 18 #import "chrome/browser/cocoa/bookmark_bar_controller.h" |
19 #import "chrome/browser/cocoa/bookmark_bubble_controller.h" | 19 #import "chrome/browser/cocoa/bookmark_bubble_controller.h" |
20 #import "chrome/browser/cocoa/view_resizer.h" | 20 #import "chrome/browser/cocoa/view_resizer.h" |
21 #import "third_party/GTM/AppKit/GTMTheme.h" | 21 #import "third_party/GTM/AppKit/GTMTheme.h" |
22 | 22 |
23 class Browser; | 23 class Browser; |
24 class BrowserWindow; | 24 class BrowserWindow; |
25 class BrowserWindowCocoa; | 25 class BrowserWindowCocoa; |
| 26 @class ChromeBrowserWindow; |
26 class ConstrainedWindowMac; | 27 class ConstrainedWindowMac; |
27 @class DownloadShelfController; | 28 @class DownloadShelfController; |
28 @class ExtensionShelfController; | 29 @class ExtensionShelfController; |
29 @class FindBarCocoaController; | 30 @class FindBarCocoaController; |
30 @class GTMWindowSheetController; | 31 @class GTMWindowSheetController; |
31 @class InfoBarContainerController; | 32 @class InfoBarContainerController; |
32 class LocationBar; | 33 class LocationBar; |
33 class StatusBubble; | 34 class StatusBubble; |
34 class TabContents; | 35 class TabContents; |
35 @class TabContentsController; | 36 @class TabContentsController; |
(...skipping 12 matching lines...) Expand all Loading... |
48 @private | 49 @private |
49 // The ordering of these members is important as it determines the order in | 50 // The ordering of these members is important as it determines the order in |
50 // which they are destroyed. |browser_| needs to be destroyed last as most of | 51 // which they are destroyed. |browser_| needs to be destroyed last as most of |
51 // the other objects hold weak references to it or things it owns | 52 // the other objects hold weak references to it or things it owns |
52 // (tab/toolbar/bookmark models, profiles, etc). We hold a strong ref to the | 53 // (tab/toolbar/bookmark models, profiles, etc). We hold a strong ref to the |
53 // window so that it will live after the NSWindowController dealloc has run | 54 // window so that it will live after the NSWindowController dealloc has run |
54 // (which happens *before* these scoped pointers are torn down). Keeping it | 55 // (which happens *before* these scoped pointers are torn down). Keeping it |
55 // alive ensures that weak view or window pointers remain valid through | 56 // alive ensures that weak view or window pointers remain valid through |
56 // their destruction sequence. | 57 // their destruction sequence. |
57 scoped_ptr<Browser> browser_; | 58 scoped_ptr<Browser> browser_; |
58 scoped_nsobject<NSWindow> window_; | 59 scoped_nsobject<ChromeBrowserWindow> window_; |
59 scoped_nsobject<NSWindow> fullscreen_window_; | 60 scoped_nsobject<NSWindow> fullscreen_window_; |
60 scoped_ptr<TabStripModelObserverBridge> tabObserver_; | 61 scoped_ptr<TabStripModelObserverBridge> tabObserver_; |
61 scoped_ptr<BrowserWindowCocoa> windowShim_; | 62 scoped_ptr<BrowserWindowCocoa> windowShim_; |
62 scoped_nsobject<ToolbarController> toolbarController_; | 63 scoped_nsobject<ToolbarController> toolbarController_; |
63 scoped_nsobject<TitlebarController> titlebarController_; | 64 scoped_nsobject<TitlebarController> titlebarController_; |
64 scoped_nsobject<TabStripController> tabStripController_; | 65 scoped_nsobject<TabStripController> tabStripController_; |
65 scoped_nsobject<FindBarCocoaController> findBarCocoaController_; | 66 scoped_nsobject<FindBarCocoaController> findBarCocoaController_; |
66 scoped_nsobject<InfoBarContainerController> infoBarContainerController_; | 67 scoped_nsobject<InfoBarContainerController> infoBarContainerController_; |
67 scoped_ptr<StatusBubble> statusBubble_; | 68 scoped_ptr<StatusBubble> statusBubble_; |
68 scoped_nsobject<DownloadShelfController> downloadShelfController_; | 69 scoped_nsobject<DownloadShelfController> downloadShelfController_; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 170 |
170 // Return an autoreleased NSWindow suitable for fullscreen use. | 171 // Return an autoreleased NSWindow suitable for fullscreen use. |
171 - (NSWindow*)fullscreenWindow; | 172 - (NSWindow*)fullscreenWindow; |
172 | 173 |
173 // Return a point suitable for the topLeft for a bookmark bubble. | 174 // Return a point suitable for the topLeft for a bookmark bubble. |
174 - (NSPoint)topLeftForBubble; | 175 - (NSPoint)topLeftForBubble; |
175 | 176 |
176 @end // BrowserWindowController(TestingAPI) | 177 @end // BrowserWindowController(TestingAPI) |
177 | 178 |
178 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 179 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
OLD | NEW |