Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: chrome/browser/cocoa/toolbar_controller.mm

Issue 155444: Mac pop-up window happier-ness.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/toolbar_controller.h ('k') | chrome/browser/cocoa/toolbar_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/toolbar_controller.mm
===================================================================
--- chrome/browser/cocoa/toolbar_controller.mm (revision 20638)
+++ chrome/browser/cocoa/toolbar_controller.mm (working copy)
@@ -86,6 +86,7 @@
profile_ = profile;
bookmarkBarDelegate_ = delegate;
webContentView_ = webContentView;
+ hasToolbar_ = YES;
// Register for notifications about state changes for the toolbar buttons
commandObserver_.reset(new CommandObserverBridge(self, commands));
@@ -98,6 +99,14 @@
return self;
}
+- (void)dealloc {
+ // Make sure any code in the base class which assumes [self view] is
+ // the "parent" view continues to work.
+ hasToolbar_ = YES;
+
+ [super dealloc];
+}
+
// Called after the view is done loading and the outlets have been hooked up.
// Now we can hook up bridges that rely on UI objects such as the location
// bar and button state.
@@ -204,7 +213,31 @@
[goButton_ setTag:tag];
}
+- (void)setHasToolbar:(BOOL)toolbar {
+ [self view]; // force nib loading
+ hasToolbar_ = toolbar;
+
+ // App mode allows turning off the location bar as well.
+ // TODO(???): add more code here when implementing app mode to allow
+ // turning off both toolbar AND location bar.
+
+ // TODO(jrg): add mode code to make the location bar NOT editable
+ // when in a pop-up.
+}
+
+- (NSView*)view {
+ if (hasToolbar_)
+ return [super view];
+ return locationBar_;
+}
+
- (BookmarkBarController*)bookmarkBarController {
+ // Browser has a FEATURE_BOOKMARKBAR but it is ignored by Safari
+ // when using window.open(); the logic seems to be "if no toolbar,
+ // no bookmark bar".
+ // TODO(jrg): investigate non-Mac Chrome behavior and possibly expand this.
+ if (hasToolbar_ == NO)
+ return nil;
return bookmarkBarController_.get();
}
« no previous file with comments | « chrome/browser/cocoa/toolbar_controller.h ('k') | chrome/browser/cocoa/toolbar_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698