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

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

Issue 155785: File dropped off a popup CL (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_controller.mm
===================================================================
--- chrome/browser/cocoa/browser_window_controller.mm (revision 20638)
+++ chrome/browser/cocoa/browser_window_controller.mm (working copy)
@@ -64,8 +64,8 @@
@interface BrowserWindowController(Private)
-- (void)positionToolbar;
-- (void)removeToolbar;
+- (void)positionBar;
+- (void)removeBar;
- (void)installIncognitoBadge;
// Leopard's gradient heuristic gets confused by our tabs and makes the title
@@ -175,7 +175,12 @@
profile:browser->profile()
webContentView:[self tabContentArea]
bookmarkDelegate:self]);
- [self positionToolbar];
+ // If we are a pop-up, we have a titlebar and no toolbar.
+ if (!browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) &&
+ browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR)) {
+ [toolbarController_ setHasToolbar:NO];
+ }
+ [self positionBar];
[self fixWindowGradient];
// Create the bridge for the status bubble.
@@ -656,14 +661,14 @@
// preference.
[[toolbarController_ bookmarkBarController] setBookmarkBarEnabled:NO];
// Make room for more content area.
- [self removeToolbar];
+ [self removeBar];
// Hide the menubar, and allow it to un-hide when moving the mouse
// to the top of the screen. Does this eliminate the need for an
// info bubble describing how to exit fullscreen mode?
SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar);
} else {
SetSystemUIMode(kUIModeNormal, 0);
- [self positionToolbar];
+ [self positionBar];
[[toolbarController_ bookmarkBarController] setBookmarkBarEnabled:YES];
}
}
@@ -783,46 +788,47 @@
@implementation BrowserWindowController (Private)
// If |add| is YES:
-// Position |toolbarView_| below the tab strip, but not as a
-// sibling. The toolbar is part of the window's contentView, mainly
+// Position |barView| below the tab strip, but not as a sibling. The
+// toolbar or titlebar is part of the window's contentView, mainly
// because we want the opacity during drags to be the same as the web
// content. This can be used for either the initial add or a
// reposition.
// If |add| is NO:
-// Remove the toolbar from it's parent view (the window's content view).
-// Called when going fullscreen and we need to minimize UI.
-- (void)positionOrRemoveToolbar:(BOOL)add {
+// Remove the toolbar or titlebar from it's parent view (the window's
+// content view). Called when going fullscreen and we need to
+// minimize UI.
+- (void)positionOrRemoveBar:(BOOL)add {
+ NSView* barView = [toolbarController_ view];
+ NSRect barFrame = [barView frame];
NSView* contentView = [self tabContentArea];
NSRect contentFrame = [contentView frame];
- NSView* toolbarView = [toolbarController_ view];
- NSRect toolbarFrame = [toolbarView frame];
// Shrink or grow the content area by the height of the toolbar.
if (add)
- contentFrame.size.height -= toolbarFrame.size.height;
+ contentFrame.size.height -= barFrame.size.height;
else
- contentFrame.size.height += toolbarFrame.size.height;
+ contentFrame.size.height += barFrame.size.height;
[contentView setFrame:contentFrame];
if (add) {
// Move the toolbar above the content area, within the window's content view
// (as opposed to the tab strip, which is a sibling).
- toolbarFrame.origin.y = NSMaxY(contentFrame);
- toolbarFrame.origin.x = 0;
- toolbarFrame.size.width = contentFrame.size.width;
- [toolbarView setFrame:toolbarFrame];
- [[[self window] contentView] addSubview:toolbarView];
+ barFrame.origin.y = NSMaxY(contentFrame);
+ barFrame.origin.x = 0;
+ barFrame.size.width = contentFrame.size.width;
+ [barView setFrame:barFrame];
+ [[[self window] contentView] addSubview:barView];
} else {
- [toolbarView removeFromSuperview];
+ [barView removeFromSuperview];
}
}
-- (void)positionToolbar {
- [self positionOrRemoveToolbar:YES];
+- (void)positionBar {
+ [self positionOrRemoveBar:YES];
}
-- (void)removeToolbar {
- [self positionOrRemoveToolbar:NO];
+- (void)removeBar {
+ [self positionOrRemoveBar:NO];
}
// If the browser is in incognito mode, install the image view to decorate
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698