| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <numeric> | 8 #include <numeric> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 NSScreen* screen = [sourceWindow screen]; | 1316 NSScreen* screen = [sourceWindow screen]; |
| 1317 windowRect.origin.y = NSHeight([screen frame]) - NSMaxY(windowRect); | 1317 windowRect.origin.y = NSHeight([screen frame]) - NSMaxY(windowRect); |
| 1318 gfx::Rect browserRect(windowRect.origin.x, windowRect.origin.y, | 1318 gfx::Rect browserRect(windowRect.origin.x, windowRect.origin.y, |
| 1319 NSWidth(windowRect), NSHeight(windowRect)); | 1319 NSWidth(windowRect), NSHeight(windowRect)); |
| 1320 | 1320 |
| 1321 NSRect sourceTabRect = [tabView frame]; | 1321 NSRect sourceTabRect = [tabView frame]; |
| 1322 NSView* tabStrip = [self tabStripView]; | 1322 NSView* tabStrip = [self tabStripView]; |
| 1323 | 1323 |
| 1324 // Pushes tabView's frame back inside the tabstrip. | 1324 // Pushes tabView's frame back inside the tabstrip. |
| 1325 NSSize tabOverflow = | 1325 NSSize tabOverflow = |
| 1326 [self overflowFrom:[tabStrip convertRectToBase:sourceTabRect] | 1326 [self overflowFrom:[tabStrip convertRect:sourceTabRect toView:nil] |
| 1327 to:[tabStrip frame]]; | 1327 to:[tabStrip frame]]; |
| 1328 NSRect tabRect = NSOffsetRect(sourceTabRect, | 1328 NSRect tabRect = NSOffsetRect(sourceTabRect, |
| 1329 -tabOverflow.width, -tabOverflow.height); | 1329 -tabOverflow.width, -tabOverflow.height); |
| 1330 | 1330 |
| 1331 // Before detaching the tab, store the pinned state. | 1331 // Before detaching the tab, store the pinned state. |
| 1332 bool isPinned = browser_->IsTabPinned(index); | 1332 bool isPinned = browser_->IsTabPinned(index); |
| 1333 | 1333 |
| 1334 // Detach it from the source window, which just updates the model without | 1334 // Detach it from the source window, which just updates the model without |
| 1335 // deleting the tab contents. This needs to come before creating the new | 1335 // deleting the tab contents. This needs to come before creating the new |
| 1336 // Browser because it clears the WebContents' delegate, which gets hooked | 1336 // Browser because it clears the WebContents' delegate, which gets hooked |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2217 | 2217 |
| 2218 - (BOOL)supportsBookmarkBar { | 2218 - (BOOL)supportsBookmarkBar { |
| 2219 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2219 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2220 } | 2220 } |
| 2221 | 2221 |
| 2222 - (BOOL)isTabbedWindow { | 2222 - (BOOL)isTabbedWindow { |
| 2223 return browser_->is_type_tabbed(); | 2223 return browser_->is_type_tabbed(); |
| 2224 } | 2224 } |
| 2225 | 2225 |
| 2226 @end // @implementation BrowserWindowController(WindowType) | 2226 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |