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

Unified Diff: chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm

Issue 817273003: [Mac] Make ConstrainedWebDialog resize with parent window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/constrained_window/constrained_window_web_dialog_sheet.mm
diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm
new file mode 100644
index 0000000000000000000000000000000000000000..7da75cf5a5b8769e84ef69f711b1869a58f08b0d
--- /dev/null
+++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm
@@ -0,0 +1,30 @@
+// Copyright 2014 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/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.h"
+
+#include "ui/gfx/size.h"
+#include "ui/web_dialogs/web_dialog_delegate.h"
+
+@implementation WebDialogConstrainedWindowSheet
+
+- (id)initWithCustomWindow:(NSWindow*)customWindow
+ webDialogDelegate:(ui::WebDialogDelegate*)delegate {
+ if (self = [super initWithCustomWindow:customWindow]) {
+ web_dialog_delegate_ = delegate;
+ }
+
+ return self;
+}
+
+- (void)updateSheetPosition {
+ if (web_dialog_delegate_) {
+ gfx::Size size;
+ web_dialog_delegate_->GetDialogSize(&size);
+ [customWindow_ setContentSize:NSMakeSize(size.width(), size.height())];
+ }
+ [super updateSheetPosition];
+}
+
+@end
« no previous file with comments | « chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698