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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 659823003: Nasty hack to pick the right origin for a sheet above an app window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« 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