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/tabs/tab_strip_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
6 | 6 |
7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <limits> | 10 #include <limits> |
(...skipping 2296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2307 // -[TabStripController swapInTabAtIndex:] too. | 2307 // -[TabStripController swapInTabAtIndex:] too. |
2308 return [web_contents->GetNativeView() superview]; | 2308 return [web_contents->GetNativeView() superview]; |
2309 } | 2309 } |
2310 | 2310 |
2311 NSRect GetSheetParentBoundsForParentView(NSView* view) { | 2311 NSRect GetSheetParentBoundsForParentView(NSView* view) { |
2312 // If the devtools view is open, it shrinks the size of the WebContents, so go | 2312 // If the devtools view is open, it shrinks the size of the WebContents, so go |
2313 // up the hierarchy to the devtools container view to avoid that. Note that | 2313 // up the hierarchy to the devtools container view to avoid that. Note that |
2314 // the devtools view is always in the hierarchy even if it is not open or it | 2314 // the devtools view is always in the hierarchy even if it is not open or it |
2315 // is detached. | 2315 // is detached. |
2316 NSView* devtools_view = [[[view superview] superview] superview]; | 2316 NSView* devtools_view = [[[view superview] superview] superview]; |
2317 return [devtools_view convertRect:[devtools_view bounds] toView:nil]; | 2317 if (devtools_view) { |
| 2318 return [devtools_view convertRect:[devtools_view bounds] toView:nil]; |
| 2319 } else { |
| 2320 return [view convertRect:[view bounds] toView:nil]; |
| 2321 } |
2318 } | 2322 } |
OLD | NEW |