Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/javascript_dialogs/javascript_dialog.h" | 5 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
|
Avi (use Gerrit)
2016/10/28 04:27:50
you don't need this include then
tapted
2016/10/28 04:48:25
Done.
| |
| 8 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_views.h" | 8 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_views.h" |
| 9 | 9 |
| 10 #if defined(OS_MACOSX) | |
| 11 #include "chrome/browser/ui/browser_dialogs.h" | |
| 12 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_cocoa.h" | |
| 13 #endif | |
| 14 | |
| 15 JavaScriptDialog::~JavaScriptDialog() = default; | 10 JavaScriptDialog::~JavaScriptDialog() = default; |
| 16 | 11 |
| 17 base::WeakPtr<JavaScriptDialog> JavaScriptDialog::Create( | 12 base::WeakPtr<JavaScriptDialog> JavaScriptDialog::Create( |
| 18 content::WebContents* parent_web_contents, | 13 content::WebContents* parent_web_contents, |
| 19 content::WebContents* alerting_web_contents, | 14 content::WebContents* alerting_web_contents, |
| 20 const base::string16& title, | 15 const base::string16& title, |
| 21 content::JavaScriptMessageType message_type, | 16 content::JavaScriptMessageType message_type, |
| 22 const base::string16& message_text, | 17 const base::string16& message_text, |
| 23 const base::string16& default_prompt_text, | 18 const base::string16& default_prompt_text, |
| 24 const content::JavaScriptDialogManager::DialogClosedCallback& | 19 const content::JavaScriptDialogManager::DialogClosedCallback& |
| 25 dialog_callback) { | 20 dialog_callback) { |
| 26 #if defined(OS_MACOSX) | 21 return JavaScriptDialogViews::Create( |
| 27 if (chrome::ToolkitViewsWebUIDialogsEnabled()) { | 22 parent_web_contents, alerting_web_contents, title, message_type, |
| 28 #endif | 23 message_text, default_prompt_text, dialog_callback); |
| 29 return JavaScriptDialogViews::Create( | |
| 30 parent_web_contents, alerting_web_contents, title, message_type, | |
| 31 message_text, default_prompt_text, dialog_callback); | |
| 32 #if defined(OS_MACOSX) | |
| 33 } else { | |
| 34 return JavaScriptDialogCocoa::Create( | |
| 35 parent_web_contents, alerting_web_contents, title, message_type, | |
| 36 message_text, default_prompt_text, dialog_callback); | |
| 37 } | |
| 38 #endif | |
| 39 } | 24 } |
| OLD | NEW |