| 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/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 WebDialogDelegate* delegate, | 238 WebDialogDelegate* delegate, |
| 239 content::WebContents* web_contents) { | 239 content::WebContents* web_contents) { |
| 240 // Deleted when the dialog closes. | 240 // Deleted when the dialog closes. |
| 241 ConstrainedWebDialogDelegateViewMac* constrained_delegate = | 241 ConstrainedWebDialogDelegateViewMac* constrained_delegate = |
| 242 new ConstrainedWebDialogDelegateViewMac( | 242 new ConstrainedWebDialogDelegateViewMac( |
| 243 browser_context, delegate, web_contents, | 243 browser_context, delegate, web_contents, |
| 244 gfx::Size(), gfx::Size()); | 244 gfx::Size(), gfx::Size()); |
| 245 return constrained_delegate; | 245 return constrained_delegate; |
| 246 } | 246 } |
| 247 | 247 |
| 248 ConstrainedWebDialogDelegate* ShowTopLevelConstrainedWebDialog( |
| 249 content::BrowserContext* browser_context, |
| 250 WebDialogDelegate* delegate, |
| 251 content::WebContents* web_contents) { |
| 252 // Mac uses sheets, so we can just use the normal ShowConstrainedWebDialog. |
| 253 return ShowConstrainedWebDialog(browser_context, delegate, web_contents); |
| 254 } |
| 255 |
| 256 // Mac uses sheets so there is no need for this function. Use the normal |
| 257 // ShowConstrainedWebDialog. |
| 258 ConstrainedWebDialogDelegate* ShowTopLevelConstrainedWebDialogInWindow( |
| 259 content::BrowserContext* browser_context, |
| 260 ui::WebDialogDelegate* delegate, |
| 261 content::WebContents* web_contents, |
| 262 gfx::NativeView dialog_host_window) { |
| 263 return ShowConstrainedWebDialog(browser_context, delegate, web_contents); |
| 264 } |
| 265 |
| 248 ConstrainedWebDialogDelegate* ShowConstrainedWebDialogWithAutoResize( | 266 ConstrainedWebDialogDelegate* ShowConstrainedWebDialogWithAutoResize( |
| 249 content::BrowserContext* browser_context, | 267 content::BrowserContext* browser_context, |
| 250 WebDialogDelegate* delegate, | 268 WebDialogDelegate* delegate, |
| 251 content::WebContents* web_contents, | 269 content::WebContents* web_contents, |
| 252 const gfx::Size& min_size, | 270 const gfx::Size& min_size, |
| 253 const gfx::Size& max_size) { | 271 const gfx::Size& max_size) { |
| 254 DCHECK(!min_size.IsEmpty()); | 272 DCHECK(!min_size.IsEmpty()); |
| 255 DCHECK(!max_size.IsEmpty()); | 273 DCHECK(!max_size.IsEmpty()); |
| 256 // Deleted when the dialog closes. | 274 // Deleted when the dialog closes. |
| 257 ConstrainedWebDialogDelegateViewMac* constrained_delegate = | 275 ConstrainedWebDialogDelegateViewMac* constrained_delegate = |
| 258 new ConstrainedWebDialogDelegateViewMac( | 276 new ConstrainedWebDialogDelegateViewMac( |
| 259 browser_context, delegate, web_contents, | 277 browser_context, delegate, web_contents, |
| 260 min_size, max_size); | 278 min_size, max_size); |
| 261 return constrained_delegate; | 279 return constrained_delegate; |
| 262 } | 280 } |
| OLD | NEW |