Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / constrained_window / constrained_window_web_dialog_sheet.mm
blob3c71f00e0a19063454872beb63e876e6bea5a0f5
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.h"
7 #include "ui/gfx/geometry/size.h"
8 #include "ui/web_dialogs/web_dialog_delegate.h"
10 @implementation WebDialogConstrainedWindowSheet
12 - (id)initWithCustomWindow:(NSWindow*)customWindow
13          webDialogDelegate:(ui::WebDialogDelegate*)delegate {
14   if (self = [super initWithCustomWindow:customWindow]) {
15     web_dialog_delegate_ = delegate;
16   }
18   return self;
21 - (void)updateSheetPosition {
22   if (web_dialog_delegate_) {
23     gfx::Size size;
24     web_dialog_delegate_->GetDialogSize(&size);
25     [customWindow_ setContentSize:NSMakeSize(size.width(), size.height())];
26   }
27   [super updateSheetPosition];
30 @end