| 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 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" | 5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/memory/scoped_nsobject.h" | 9 #include "base/memory/scoped_nsobject.h" |
| 10 #include "chrome/browser/ui/cocoa/constrained_window_mac.h" | 10 #include "chrome/browser/ui/cocoa/constrained_window_mac.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 Profile* profile, | 121 Profile* profile, |
| 122 WebDialogDelegate* delegate, | 122 WebDialogDelegate* delegate, |
| 123 WebDialogWebContentsDelegate* tab_delegate, | 123 WebDialogWebContentsDelegate* tab_delegate, |
| 124 TabContents* tab_contents) { | 124 TabContents* tab_contents) { |
| 125 // Deleted when ConstrainedWebDialogDelegateMac::DeleteDelegate() runs. | 125 // Deleted when ConstrainedWebDialogDelegateMac::DeleteDelegate() runs. |
| 126 ConstrainedWebDialogDelegateMac* constrained_delegate = | 126 ConstrainedWebDialogDelegateMac* constrained_delegate = |
| 127 new ConstrainedWebDialogDelegateMac(profile, delegate, tab_delegate); | 127 new ConstrainedWebDialogDelegateMac(profile, delegate, tab_delegate); |
| 128 // Deleted when ConstrainedWebDialogDelegateMac::OnDialogCloseFromWebUI() | 128 // Deleted when ConstrainedWebDialogDelegateMac::OnDialogCloseFromWebUI() |
| 129 // runs. | 129 // runs. |
| 130 ConstrainedWindow* constrained_window = | 130 ConstrainedWindow* constrained_window = |
| 131 new ConstrainedWindowMac(tab_contents, constrained_delegate); | 131 new ConstrainedWindowMac(tab_contents->web_contents(), |
| 132 constrained_delegate); |
| 132 constrained_delegate->set_window(constrained_window); | 133 constrained_delegate->set_window(constrained_window); |
| 133 return constrained_delegate; | 134 return constrained_delegate; |
| 134 } | 135 } |
| 135 | 136 |
| 136 @implementation ConstrainedWebDialogSheetCocoa | 137 @implementation ConstrainedWebDialogSheetCocoa |
| 137 | 138 |
| 138 - (id)initWithConstrainedWebDialogDelegateMac: | 139 - (id)initWithConstrainedWebDialogDelegateMac: |
| 139 (ConstrainedWebDialogDelegateMac*)ConstrainedWebDialogDelegateMac { | 140 (ConstrainedWebDialogDelegateMac*)ConstrainedWebDialogDelegateMac { |
| 140 if ((self = [super init])) | 141 if ((self = [super init])) |
| 141 constrainedWebDelegate_ = ConstrainedWebDialogDelegateMac; | 142 constrainedWebDelegate_ = ConstrainedWebDialogDelegateMac; |
| 142 return self; | 143 return self; |
| 143 } | 144 } |
| 144 | 145 |
| 145 - (void)sheetDidEnd:(NSWindow*)sheet | 146 - (void)sheetDidEnd:(NSWindow*)sheet |
| 146 returnCode:(int)returnCode | 147 returnCode:(int)returnCode |
| 147 contextInfo:(void *)contextInfo { | 148 contextInfo:(void *)contextInfo { |
| 148 [sheet orderOut:self]; | 149 [sheet orderOut:self]; |
| 149 } | 150 } |
| 150 | 151 |
| 151 @end | 152 @end |
| OLD | NEW |