| 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 "content/shell/shell_javascript_dialog.h" | 5 #include "content/shell/shell_javascript_dialog.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "content/shell/resource.h" | 8 #include "content/shell/resource.h" |
| 9 #include "content/shell/shell.h" | 9 #include "content/shell/shell.h" |
| 10 #include "content/shell/shell_javascript_dialog_creator.h" | 10 #include "content/shell/shell_javascript_dialog_creator.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 break; | 70 break; |
| 71 } | 71 } |
| 72 default: | 72 default: |
| 73 return DefWindowProc(dialog, message, wparam, lparam); | 73 return DefWindowProc(dialog, message, wparam, lparam); |
| 74 } | 74 } |
| 75 return 0; | 75 return 0; |
| 76 } | 76 } |
| 77 | 77 |
| 78 ShellJavaScriptDialog::ShellJavaScriptDialog( | 78 ShellJavaScriptDialog::ShellJavaScriptDialog( |
| 79 ShellJavaScriptDialogCreator* creator, | 79 ShellJavaScriptDialogCreator* creator, |
| 80 gfx::NativeWindow parent_window, |
| 80 JavaScriptMessageType message_type, | 81 JavaScriptMessageType message_type, |
| 81 const string16& message_text, | 82 const string16& message_text, |
| 82 const string16& default_prompt_text, | 83 const string16& default_prompt_text, |
| 83 const JavaScriptDialogCreator::DialogClosedCallback& callback) | 84 const JavaScriptDialogCreator::DialogClosedCallback& callback) |
| 84 : creator_(creator), | 85 : creator_(creator), |
| 85 callback_(callback), | 86 callback_(callback), |
| 86 message_text_(message_text), | 87 message_text_(message_text), |
| 87 default_prompt_text_(default_prompt_text), | 88 default_prompt_text_(default_prompt_text), |
| 88 message_type_(message_type) { | 89 message_type_(message_type) { |
| 89 int dialog_type; | 90 int dialog_type; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 103 ShellJavaScriptDialog::~ShellJavaScriptDialog() { | 104 ShellJavaScriptDialog::~ShellJavaScriptDialog() { |
| 104 Cancel(); | 105 Cancel(); |
| 105 } | 106 } |
| 106 | 107 |
| 107 void ShellJavaScriptDialog::Cancel() { | 108 void ShellJavaScriptDialog::Cancel() { |
| 108 if (dialog_win_) | 109 if (dialog_win_) |
| 109 DestroyWindow(dialog_win_); | 110 DestroyWindow(dialog_win_); |
| 110 } | 111 } |
| 111 | 112 |
| 112 } // namespace content | 113 } // namespace content |
| OLD | NEW |