| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/js_modal_dialog_views.h" | 5 #include "chrome/browser/ui/views/js_modal_dialog_views.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" | 8 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" |
| 9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
| 10 #include "ui/base/keycodes/keyboard_codes.h" | 10 #include "ui/base/keycodes/keyboard_codes.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 if (parent->javascript_message_type() == ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT) | 22 if (parent->javascript_message_type() == ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT) |
| 23 options |= views::MessageBoxView::HAS_PROMPT_FIELD; | 23 options |= views::MessageBoxView::HAS_PROMPT_FIELD; |
| 24 | 24 |
| 25 views::MessageBoxView::InitParams params(parent->message_text()); | 25 views::MessageBoxView::InitParams params(parent->message_text()); |
| 26 params.options = options; | 26 params.options = options; |
| 27 params.default_prompt = parent->default_prompt_text(); | 27 params.default_prompt = parent->default_prompt_text(); |
| 28 message_box_view_ = new views::MessageBoxView(params); | 28 message_box_view_ = new views::MessageBoxView(params); |
| 29 DCHECK(message_box_view_); | 29 DCHECK(message_box_view_); |
| 30 | 30 |
| 31 message_box_view_->AddAccelerator( | 31 message_box_view_->AddAccelerator( |
| 32 ui::Accelerator(ui::VKEY_C, ui::EF_CONTROL_DOWN)); | 32 ui::Accelerator(ui::VKEY_C, ui::EF_CONTROL_DOWN, ui::ET_KEY_PRESSED)); |
| 33 if (parent->display_suppress_checkbox()) { | 33 if (parent->display_suppress_checkbox()) { |
| 34 message_box_view_->SetCheckBoxLabel( | 34 message_box_view_->SetCheckBoxLabel( |
| 35 l10n_util::GetStringUTF16(IDS_JAVASCRIPT_MESSAGEBOX_SUPPRESS_OPTION)); | 35 l10n_util::GetStringUTF16(IDS_JAVASCRIPT_MESSAGEBOX_SUPPRESS_OPTION)); |
| 36 } | 36 } |
| 37 } | 37 } |
| 38 | 38 |
| 39 JSModalDialogViews::~JSModalDialogViews() { | 39 JSModalDialogViews::~JSModalDialogViews() { |
| 40 } | 40 } |
| 41 | 41 |
| 42 //////////////////////////////////////////////////////////////////////////////// | 42 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // NativeAppModalDialog, public: | 154 // NativeAppModalDialog, public: |
| 155 | 155 |
| 156 // static | 156 // static |
| 157 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( | 157 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( |
| 158 JavaScriptAppModalDialog* dialog, | 158 JavaScriptAppModalDialog* dialog, |
| 159 gfx::NativeWindow parent_window) { | 159 gfx::NativeWindow parent_window) { |
| 160 JSModalDialogViews* d = new JSModalDialogViews(dialog); | 160 JSModalDialogViews* d = new JSModalDialogViews(dialog); |
| 161 views::Widget::CreateWindowWithParent(d, parent_window); | 161 views::Widget::CreateWindowWithParent(d, parent_window); |
| 162 return d; | 162 return d; |
| 163 } | 163 } |
| OLD | NEW |