OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog.h" |
| 6 |
| 7 #include "build/build_config.h" |
| 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" |
| 12 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_cocoa.h" |
| 13 #endif |
| 14 |
| 15 JavaScriptDialog::~JavaScriptDialog() = default; |
| 16 |
| 17 base::WeakPtr<JavaScriptDialog> JavaScriptDialog::Create( |
| 18 content::WebContents* parent_web_contents, |
| 19 content::WebContents* alerting_web_contents, |
| 20 const base::string16& title, |
| 21 content::JavaScriptMessageType message_type, |
| 22 const base::string16& message_text, |
| 23 const base::string16& default_prompt_text, |
| 24 const content::JavaScriptDialogManager::DialogClosedCallback& |
| 25 dialog_callback) { |
| 26 #if defined(OS_MACOSX) |
| 27 if (chrome::ToolkitViewsWebUIDialogsEnabled()) { |
| 28 #endif |
| 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 } |
OLD | NEW |