| 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 "components/constrained_window/constrained_window_views.h" | 9 #include "components/constrained_window/constrained_window_views.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "ui/views/controls/message_box_view.h" | 11 #include "ui/views/controls/message_box_view.h" |
| 11 #include "ui/views/controls/textfield/textfield.h" | 12 #include "ui/views/controls/textfield/textfield.h" |
| 12 #include "ui/views/layout/layout_constants.h" | 13 #include "ui/views/layout/layout_constants.h" |
| 13 | 14 |
| 14 JavaScriptDialogViews::~JavaScriptDialogViews() = default; | 15 JavaScriptDialogViews::~JavaScriptDialogViews() = default; |
| 15 | 16 |
| 16 // static | 17 // static |
| 17 base::WeakPtr<JavaScriptDialogViews> JavaScriptDialogViews::Create( | 18 base::WeakPtr<JavaScriptDialogViews> JavaScriptDialogViews::Create( |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 if (dialog_type == content::JAVASCRIPT_DIALOG_TYPE_PROMPT) | 115 if (dialog_type == content::JAVASCRIPT_DIALOG_TYPE_PROMPT) |
| 115 options |= views::MessageBoxView::HAS_PROMPT_FIELD; | 116 options |= views::MessageBoxView::HAS_PROMPT_FIELD; |
| 116 | 117 |
| 117 views::MessageBoxView::InitParams params(message_text); | 118 views::MessageBoxView::InitParams params(message_text); |
| 118 params.options = options; | 119 params.options = options; |
| 119 params.default_prompt = default_prompt_text; | 120 params.default_prompt = default_prompt_text; |
| 120 message_box_view_ = new views::MessageBoxView(params); | 121 message_box_view_ = new views::MessageBoxView(params); |
| 121 DCHECK(message_box_view_); | 122 DCHECK(message_box_view_); |
| 122 | 123 |
| 123 constrained_window::ShowWebModalDialogViews(this, parent_web_contents); | 124 constrained_window::ShowWebModalDialogViews(this, parent_web_contents); |
| 125 chrome::RecordDialogCreation(chrome::DialogIdentifier::JAVA_SCRIPT); |
| 124 } | 126 } |
| OLD | NEW |