OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_html_ui.h" | 5 #include "chrome/browser/ui/webui/constrained_html_ui.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/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // static | 133 // static |
134 ConstrainedWindow* ConstrainedHtmlUI::CreateConstrainedHtmlDialog( | 134 ConstrainedWindow* ConstrainedHtmlUI::CreateConstrainedHtmlDialog( |
135 Profile* profile, | 135 Profile* profile, |
136 HtmlDialogUIDelegate* delegate, | 136 HtmlDialogUIDelegate* delegate, |
137 TabContentsWrapper* wrapper) { | 137 TabContentsWrapper* wrapper) { |
138 // Deleted when ConstrainedHtmlDelegateMac::DeleteDelegate() runs. | 138 // Deleted when ConstrainedHtmlDelegateMac::DeleteDelegate() runs. |
139 ConstrainedHtmlDelegateMac* constrained_delegate = | 139 ConstrainedHtmlDelegateMac* constrained_delegate = |
140 new ConstrainedHtmlDelegateMac(profile, delegate); | 140 new ConstrainedHtmlDelegateMac(profile, delegate); |
141 // Deleted when ConstrainedHtmlDelegateMac::OnDialogCloseFromWebUI() runs. | 141 // Deleted when ConstrainedHtmlDelegateMac::OnDialogCloseFromWebUI() runs. |
142 ConstrainedWindow* constrained_window = | 142 ConstrainedWindow* constrained_window = |
143 new ConstrainedWindowMac(wrapper->tab_contents(), constrained_delegate); | 143 new ConstrainedWindowMac(wrapper, constrained_delegate); |
144 constrained_delegate->set_window(constrained_window); | 144 constrained_delegate->set_window(constrained_window); |
145 return constrained_window; | 145 return constrained_window; |
146 } | 146 } |
147 | 147 |
148 @implementation ConstrainedHtmlDialogSheetCocoa | 148 @implementation ConstrainedHtmlDialogSheetCocoa |
149 | 149 |
150 - (id)initWithConstrainedHtmlDelegateMac: | 150 - (id)initWithConstrainedHtmlDelegateMac: |
151 (ConstrainedHtmlDelegateMac*)ConstrainedHtmlDelegateMac { | 151 (ConstrainedHtmlDelegateMac*)ConstrainedHtmlDelegateMac { |
152 if ((self = [super init])) | 152 if ((self = [super init])) |
153 constrainedHtmlDelegate_ = ConstrainedHtmlDelegateMac; | 153 constrainedHtmlDelegate_ = ConstrainedHtmlDelegateMac; |
154 return self; | 154 return self; |
155 } | 155 } |
156 | 156 |
157 - (void)sheetDidEnd:(NSWindow*)sheet | 157 - (void)sheetDidEnd:(NSWindow*)sheet |
158 returnCode:(int)returnCode | 158 returnCode:(int)returnCode |
159 contextInfo:(void *)contextInfo { | 159 contextInfo:(void *)contextInfo { |
160 [sheet orderOut:self]; | 160 [sheet orderOut:self]; |
161 } | 161 } |
162 | 162 |
163 @end | 163 @end |
OLD | NEW |