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
tapted
2016/10/28 04:48:25
Done.
| |
| 8 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_views.h" | |
| 9 | |
| 10 #if defined(OS_MACOSX) | |
| 11 #include "chrome/browser/ui/browser_dialogs.h" | 8 #include "chrome/browser/ui/browser_dialogs.h" |
| 12 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_cocoa.h" | 9 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_cocoa.h" |
| 13 #endif | 10 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_views.h" |
| 14 | 11 |
| 15 JavaScriptDialog::~JavaScriptDialog() = default; | 12 JavaScriptDialog::~JavaScriptDialog() = default; |
| 16 | 13 |
| 17 base::WeakPtr<JavaScriptDialog> JavaScriptDialog::Create( | 14 base::WeakPtr<JavaScriptDialog> JavaScriptDialog::Create( |
| 18 content::WebContents* parent_web_contents, | 15 content::WebContents* parent_web_contents, |
| 19 content::WebContents* alerting_web_contents, | 16 content::WebContents* alerting_web_contents, |
| 20 const base::string16& title, | 17 const base::string16& title, |
| 21 content::JavaScriptMessageType message_type, | 18 content::JavaScriptMessageType message_type, |
| 22 const base::string16& message_text, | 19 const base::string16& message_text, |
| 23 const base::string16& default_prompt_text, | 20 const base::string16& default_prompt_text, |
| 24 const content::JavaScriptDialogManager::DialogClosedCallback& | 21 const content::JavaScriptDialogManager::DialogClosedCallback& |
| 25 dialog_callback) { | 22 dialog_callback) { |
| 26 #if defined(OS_MACOSX) | |
| 27 if (chrome::ToolkitViewsWebUIDialogsEnabled()) { | 23 if (chrome::ToolkitViewsWebUIDialogsEnabled()) { |
| 28 #endif | |
| 29 return JavaScriptDialogViews::Create( | 24 return JavaScriptDialogViews::Create( |
| 30 parent_web_contents, alerting_web_contents, title, message_type, | 25 parent_web_contents, alerting_web_contents, title, message_type, |
| 31 message_text, default_prompt_text, dialog_callback); | 26 message_text, default_prompt_text, dialog_callback); |
| 32 #if defined(OS_MACOSX) | |
| 33 } else { | 27 } else { |
| 34 return JavaScriptDialogCocoa::Create( | 28 return JavaScriptDialogCocoa::Create( |
| 35 parent_web_contents, alerting_web_contents, title, message_type, | 29 parent_web_contents, alerting_web_contents, title, message_type, |
| 36 message_text, default_prompt_text, dialog_callback); | 30 message_text, default_prompt_text, dialog_callback); |
| 37 } | 31 } |
| 38 #endif | |
| 39 } | 32 } |
| OLD | NEW |