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

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

Issue 164547: Mac: make save/open dialogs operate as tab-modal sheets.... Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Painfully (but hopefully correctly) merged ToT. Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/tab_contents_controller_view.h ('k') | chrome/browser/cocoa/tab_strip_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_contents_controller_view.mm
diff --git a/chrome/browser/cocoa/tab_contents_controller_view.mm b/chrome/browser/cocoa/tab_contents_controller_view.mm
new file mode 100644
index 0000000000000000000000000000000000000000..aec6f7b77fd287576273d2ff35e5b68a2a4431c5
--- /dev/null
+++ b/chrome/browser/cocoa/tab_contents_controller_view.mm
@@ -0,0 +1,53 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "chrome/browser/cocoa/tab_contents_controller_view.h"
+
+#include "base/logging.h"
+#import "chrome/browser/cocoa/browser_window_controller.h"
+
+@implementation TabContentsControllerView
+
+- (CGFloat)toolbarHeight {
+ if ([self superview]) {
+ BrowserWindowController* controller = [[self window] windowController];
+ DCHECK([controller isKindOfClass:[BrowserWindowController class]]);
+ NSRect frame = [[[controller toolbarController] view] frame];
+ return frame.size.height;
+ }
+
+ NOTREACHED();
+ return 0.0;
+}
+
+- (CGFloat)infobarsHeight {
+ if ([self superview]) {
+ BrowserWindowController* controller = [[self window] windowController];
+ DCHECK([controller isKindOfClass:[BrowserWindowController class]]);
+ NSRect frame = [[[controller infoBarContainerController] view] frame];
+ return frame.size.height;
+ }
+
+ NOTREACHED();
+ return 0.0;
+}
+
+- (NSRect)frameWithBars {
+ // Extra height *above*.
+ CGFloat extra_height = [self toolbarHeight] + [self infobarsHeight];
+
+ NSRect frame = [self frame];
+ frame.size.height += extra_height;
+ if ([[self superview] isFlipped])
+ frame.origin.y -= extra_height;
+ return frame;
+}
+
+- (NSRect)positionSheetBelowToolbar:(NSWindow *)sheet
+ usingRect:(NSRect)defaultSheetRect {
+ defaultSheetRect.origin.y -= [self toolbarHeight];
+ return defaultSheetRect;
+}
+
+@end // @implementation TabContentsControllerView
« no previous file with comments | « chrome/browser/cocoa/tab_contents_controller_view.h ('k') | chrome/browser/cocoa/tab_strip_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698