summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/browser_window_controller.h
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-13 12:53:03 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-13 12:53:03 +0000
commitc9b0cbdfe3a92f8e7413fb89fa67d25864eebc0f (patch)
treed7e8c2f65660051a38b3e4d58b4df0a12ccd174f /chrome/browser/cocoa/browser_window_controller.h
parent34ff04759ed15031330cd7006a2003ce4504a49f (diff)
downloadchromium_src-c9b0cbdfe3a92f8e7413fb89fa67d25864eebc0f.zip
chromium_src-c9b0cbdfe3a92f8e7413fb89fa67d25864eebc0f.tar.gz
chromium_src-c9b0cbdfe3a92f8e7413fb89fa67d25864eebc0f.tar.bz2
Convert more members to scoped pointers. Move status bubble into browser window controller. Move extra window retain into BWC because it's needed for things in there, not the BrowserWindow impl. Be explicit about the ordering and nature of the ownership in BWC, which should be better since it's now all in one place. Clean up a lot of un-used cruft in tab strip and tab contents now that the toolbaris no longer there, preparing for the BookmarkBar to leave as well.
Review URL: http://codereview.chromium.org/66047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13589 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller.h')
-rw-r--r--chrome/browser/cocoa/browser_window_controller.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.h b/chrome/browser/cocoa/browser_window_controller.h
index e795273..aab0345 100644
--- a/chrome/browser/cocoa/browser_window_controller.h
+++ b/chrome/browser/cocoa/browser_window_controller.h
@@ -15,12 +15,12 @@
#include "base/scoped_nsobject.h"
#include "base/scoped_ptr.h"
#import "chrome/browser/cocoa/tab_window_controller.h"
-#import "chrome/browser/cocoa/toolbar_view.h"
class Browser;
class BrowserWindow;
class BrowserWindowCocoa;
class LocationBar;
+class StatusBubble;
class TabContents;
@class TabContentsController;
@class TabStripController;
@@ -31,27 +31,40 @@ class TabStripModelObserverBridge;
@interface BrowserWindowController :
TabWindowController<NSUserInterfaceValidations> {
@private
+ // The ordering of these members is important as it determines the order in
+ // which they are destroyed. |browser_| needs to be destroyed last as most of
+ // the other objects hold weak references to it or things it owns
+ // (tab/toolbar/bookmark models, profiles, etc). We hold a strong ref to the
+ // window so that it will live after the NSWindowController dealloc has run
+ // (which happens *before* these scoped pointers are torn down). Keeping it
+ // alive ensures that weak view or window pointers remain valid through
+ // their destruction sequence.
scoped_ptr<Browser> browser_;
+ scoped_nsobject<NSWindow> window_;
scoped_ptr<TabStripModelObserverBridge> tabObserver_;
scoped_ptr<BrowserWindowCocoa> windowShim_;
scoped_nsobject<ToolbarController> toolbarController_;
scoped_nsobject<TabStripController> tabStripController_;
+ scoped_ptr<StatusBubble> statusBubble_;
}
// Load the browser window nib and do any Cocoa-specific initialization.
// Takes ownership of |browser|.
- (id)initWithBrowser:(Browser*)browser;
-// call to make the browser go away from other places in the cross-platform
+// Call to make the browser go away from other places in the cross-platform
// code.
- (void)destroyBrowser;
-// Access the C++ bridge between the NSWindow and the rest of Chromium
+// Access the C++ bridge between the NSWindow and the rest of Chromium.
- (BrowserWindow*)browserWindow;
-// Get the C++ bridge object representing the location bar for the current tab.
+// Access the C++ bridge object representing the location bar.
- (LocationBar*)locationBar;
+// Access the C++ bridge object representing the status bubble for the window.
+- (StatusBubble*)statusBubble;
+
// Updates the toolbar (and transitively the location bar) with the states of
// the specified |tab|. If |shouldRestore| is true, we're switching
// (back?) to this tab and should restore any previous location bar state