OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/app_modal_dialog.h" | 8 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" |
9 #include "chrome/browser/ui/dialog_style.h" | 9 #include "chrome/browser/ui/dialog_style.h" |
10 #include "chrome/browser/ui/views/window.h" | 10 #include "chrome/browser/ui/views/window.h" |
11 #include "grit/generated_resources.h" | 11 #include "grit/generated_resources.h" |
12 #include "ui/base/keycodes/keyboard_codes.h" | 12 #include "ui/base/keycodes/keyboard_codes.h" |
13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
14 #include "ui/base/message_box_flags.h" | 14 #include "ui/base/message_box_flags.h" |
15 #include "ui/views/controls/message_box_view.h" | 15 #include "ui/views/controls/message_box_view.h" |
16 #include "ui/views/controls/textfield/textfield.h" | 16 #include "ui/views/controls/textfield/textfield.h" |
17 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
18 | 18 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 string16 JSModalDialogViews::GetWindowTitle() const { | 94 string16 JSModalDialogViews::GetWindowTitle() const { |
95 return parent_->title(); | 95 return parent_->title(); |
96 } | 96 } |
97 | 97 |
98 | 98 |
99 void JSModalDialogViews::WindowClosing() { | 99 void JSModalDialogViews::WindowClosing() { |
100 } | 100 } |
101 | 101 |
102 void JSModalDialogViews::DeleteDelegate() { | 102 void JSModalDialogViews::DeleteDelegate() { |
103 delete parent_; | |
104 delete this; | 103 delete this; |
105 } | 104 } |
106 | 105 |
107 bool JSModalDialogViews::Cancel() { | 106 bool JSModalDialogViews::Cancel() { |
108 parent_->OnCancel(message_box_view_->IsCheckBoxSelected()); | 107 parent_->OnCancel(message_box_view_->IsCheckBoxSelected()); |
109 return true; | 108 return true; |
110 } | 109 } |
111 | 110 |
112 bool JSModalDialogViews::Accept() { | 111 bool JSModalDialogViews::Accept() { |
113 parent_->OnAccept(message_box_view_->GetInputText(), | 112 parent_->OnAccept(message_box_view_->GetInputText(), |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 162 |
164 // static | 163 // static |
165 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( | 164 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( |
166 JavaScriptAppModalDialog* dialog, | 165 JavaScriptAppModalDialog* dialog, |
167 gfx::NativeWindow parent_window) { | 166 gfx::NativeWindow parent_window) { |
168 JSModalDialogViews* d = new JSModalDialogViews(dialog); | 167 JSModalDialogViews* d = new JSModalDialogViews(dialog); |
169 | 168 |
170 browser::CreateViewsWindow(parent_window, d, STYLE_GENERIC); | 169 browser::CreateViewsWindow(parent_window, d, STYLE_GENERIC); |
171 return d; | 170 return d; |
172 } | 171 } |
OLD | NEW |