| 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_views.h" | 5 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_views.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/browser/ui/browser_dialogs.h" | 8 #include "chrome/browser/ui/browser_dialogs.h" |
| 9 #include "components/constrained_window/constrained_window_views.h" | 9 #include "components/constrained_window/constrained_window_views.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| 11 #include "ui/views/controls/message_box_view.h" | 11 #include "ui/views/controls/message_box_view.h" |
| 12 #include "ui/views/controls/textfield/textfield.h" | 12 #include "ui/views/controls/textfield/textfield.h" |
| 13 #include "ui/views/layout/layout_constants.h" | |
| 14 | 13 |
| 15 JavaScriptDialogViews::~JavaScriptDialogViews() = default; | 14 JavaScriptDialogViews::~JavaScriptDialogViews() = default; |
| 16 | 15 |
| 17 // static | 16 // static |
| 18 base::WeakPtr<JavaScriptDialogViews> JavaScriptDialogViews::Create( | 17 base::WeakPtr<JavaScriptDialogViews> JavaScriptDialogViews::Create( |
| 19 content::WebContents* parent_web_contents, | 18 content::WebContents* parent_web_contents, |
| 20 content::WebContents* alerting_web_contents, | 19 content::WebContents* alerting_web_contents, |
| 21 const base::string16& title, | 20 const base::string16& title, |
| 22 content::JavaScriptDialogType dialog_type, | 21 content::JavaScriptDialogType dialog_type, |
| 23 const base::string16& message_text, | 22 const base::string16& message_text, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 116 |
| 118 views::MessageBoxView::InitParams params(message_text); | 117 views::MessageBoxView::InitParams params(message_text); |
| 119 params.options = options; | 118 params.options = options; |
| 120 params.default_prompt = default_prompt_text; | 119 params.default_prompt = default_prompt_text; |
| 121 message_box_view_ = new views::MessageBoxView(params); | 120 message_box_view_ = new views::MessageBoxView(params); |
| 122 DCHECK(message_box_view_); | 121 DCHECK(message_box_view_); |
| 123 | 122 |
| 124 constrained_window::ShowWebModalDialogViews(this, parent_web_contents); | 123 constrained_window::ShowWebModalDialogViews(this, parent_web_contents); |
| 125 chrome::RecordDialogCreation(chrome::DialogIdentifier::JAVA_SCRIPT); | 124 chrome::RecordDialogCreation(chrome::DialogIdentifier::JAVA_SCRIPT); |
| 126 } | 125 } |
| OLD | NEW |