summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/browser_window_controller.h16
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm33
2 files changed, 25 insertions, 24 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.h b/chrome/browser/cocoa/browser_window_controller.h
index 3b85c99..df77819 100644
--- a/chrome/browser/cocoa/browser_window_controller.h
+++ b/chrome/browser/cocoa/browser_window_controller.h
@@ -6,14 +6,10 @@
#define CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_
// A class acting as the Objective-C controller for the Browser object. Handles
-// interactions between Cocoa and the cross-platform code. Each window has a
-// single set of toolbars (main toolbar, bookmark bar, etc) and, by virtue of
-// being a TabWindowController, a tab strip along the top.
+// interactions between Cocoa and the cross-platform code.
#import <Cocoa/Cocoa.h>
-#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"
@@ -31,11 +27,11 @@ class TabStripModelObserverBridge;
@interface BrowserWindowController :
TabWindowController<NSUserInterfaceValidations> {
@private
- scoped_ptr<Browser> browser_;
- scoped_nsobject<TabStripController> tabStripController_;
- scoped_nsobject<ToolbarController> toolbarController_;
- scoped_ptr<TabStripModelObserverBridge> tabObserver_;
- scoped_ptr<BrowserWindowCocoa> windowShim_;
+ TabStripController* tabStripController_;
+ ToolbarController* toolbarController_;
+ Browser* browser_;
+ TabStripModelObserverBridge* tabObserver_;
+ BrowserWindowCocoa* windowShim_;
}
// Load the browser window nib and do any Cocoa-specific initialization.
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index f076e26..fc1e0ec 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -27,11 +27,11 @@
// up as the window's delegate.
- (id)initWithBrowser:(Browser*)browser {
if ((self = [super initWithWindowNibName:@"BrowserWindow"])) {
- DCHECK(browser);
- browser_.reset(browser);
- tabObserver_.reset(
- new TabStripModelObserverBridge(browser->tabstrip_model(), self));
- windowShim_.reset(new BrowserWindowCocoa(browser, self, [self window]));
+ browser_ = browser;
+ DCHECK(browser_);
+ tabObserver_ = new TabStripModelObserverBridge(browser->tabstrip_model(),
+ self);
+ windowShim_ = new BrowserWindowCocoa(browser, self, [self window]);
// The window is now fully realized and |-windowDidLoad:| has been
// called. We shouldn't do much in wDL because |windowShim_| won't yet
@@ -46,17 +46,17 @@
// this window's Browser and the tab strip view. The controller will handle
// registering for the appropriate tab notifications from the back-end and
// managing the creation of new tabs.
- tabStripController_.reset([[TabStripController alloc]
- initWithView:[self tabStripView]
- switchView:[self tabContentArea]
- browser:browser_.get()]);
+ tabStripController_ = [[TabStripController alloc]
+ initWithView:[self tabStripView]
+ switchView:[self tabContentArea]
+ browser:browser_];
// Create a controller for the toolbar, giving it the toolbar model object
// and the toolbar view from the nib. The controller will handle
// registering for the appropriate command state changes from the back-end.
- toolbarController_.reset([[ToolbarController alloc]
- initWithModel:browser->toolbar_model()
- commands:browser->command_updater()]);
+ toolbarController_ = [[ToolbarController alloc]
+ initWithModel:browser->toolbar_model()
+ commands:browser->command_updater()];
[self positionToolbar];
}
return self;
@@ -64,12 +64,17 @@
- (void)dealloc {
browser_->CloseAllTabs();
+ [tabStripController_ release];
+ [toolbarController_ release];
+ delete windowShim_;
+ delete tabObserver_;
+ delete browser_;
[super dealloc];
}
// Access the C++ bridge between the NSWindow and the rest of Chromium
- (BrowserWindow*)browserWindow {
- return windowShim_.get();
+ return windowShim_;
}
// Position |toolbarView_| below the tab strip, but not as a sibling. The
@@ -142,7 +147,7 @@
// Called right after our window became the main window.
- (void)windowDidBecomeMain:(NSNotification *)notification {
- BrowserList::SetLastActive(browser_.get());
+ BrowserList::SetLastActive(browser_);
}
// Update a toggle state for an NSMenuItem if modified.