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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_window_controller.mm

Issue 423013005: Revert of mac: Fix tab dragging visual bug in Yosemite. (reland 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
index 17327c9b9ebe6da2a35e9737ff7cb18ccf1daa64..c6dfa624f0ef37063166cb708b2cc7b1306d5482 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
@@ -47,10 +47,7 @@
@implementation TabWindowController
- (id)initTabWindowControllerWithTabStrip:(BOOL)hasTabStrip {
- const CGFloat kDefaultWidth = 750;
- const CGFloat kDefaultHeight = 600;
-
- NSRect contentRect = NSMakeRect(60, 229, kDefaultWidth, kDefaultHeight);
+ NSRect contentRect = NSMakeRect(60, 229, 750, 600);
base::scoped_nsobject<FramedBrowserWindow> window(
[[FramedBrowserWindow alloc] initWithContentRect:contentRect
hasTabStrip:hasTabStrip]);
@@ -60,20 +57,14 @@
if ((self = [super initWithWindow:window])) {
[[self window] setDelegate:self];
- chromeContentView_.reset([[NSView alloc]
- initWithFrame:NSMakeRect(0, 0, kDefaultWidth, kDefaultHeight)]);
- [chromeContentView_
- setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
- [[[self window] contentView] addSubview:chromeContentView_];
-
- tabContentArea_.reset(
- [[FastResizeView alloc] initWithFrame:[chromeContentView_ bounds]]);
+ tabContentArea_.reset([[FastResizeView alloc] initWithFrame:
+ NSMakeRect(0, 0, 750, 600)]);
[tabContentArea_ setAutoresizingMask:NSViewWidthSizable |
NSViewHeightSizable];
- [chromeContentView_ addSubview:tabContentArea_];
-
- tabStripView_.reset([[TabStripView alloc]
- initWithFrame:NSMakeRect(0, 0, kDefaultWidth, 37)]);
+ [[[self window] contentView] addSubview:tabContentArea_];
+
+ tabStripView_.reset([[TabStripView alloc] initWithFrame:
+ NSMakeRect(0, 0, 750, 37)]);
[tabStripView_ setAutoresizingMask:NSViewWidthSizable |
NSViewMinYMargin];
if (hasTabStrip)
@@ -88,10 +79,6 @@
- (FastResizeView*)tabContentArea {
return tabContentArea_;
-}
-
-- (NSView*)chromeContentView {
- return chromeContentView_;
}
// Add the top tab strop to the window, above the content box and add it to the
@@ -140,7 +127,7 @@
[overlayWindow_ setOpaque:NO];
[overlayWindow_ setDelegate:self];
- originalContentView_ = self.chromeContentView;
+ originalContentView_ = [window contentView];
[window addChildWindow:overlayWindow_ ordered:NSWindowAbove];
// Explicitly set the responder to be nil here (for restoring later).
@@ -166,10 +153,7 @@
// places. The TabStripView always needs to be in front of the window's
// content view and therefore it should always be added after the content
// view is set.
- [[window contentView] addSubview:originalContentView_
- positioned:NSWindowBelow
- relativeTo:nil];
- originalContentView_.frame = [[window contentView] bounds];
+ [window setContentView:originalContentView_];
[[window cr_windowView] addSubview:[self tabStripView]];
[[window cr_windowView] updateTrackingAreas];
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_window_controller.h ('k') | chrome/browser/ui/cocoa/version_independent_window.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698