| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/jsmessage_box_handler_win.h" | 5 #include "chrome/browser/jsmessage_box_handler_win.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/app_modal_dialog_queue.h" | 8 #include "chrome/browser/app_modal_dialog_queue.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 WebContents* web_contents, | 37 WebContents* web_contents, |
| 38 int dialog_flags, | 38 int dialog_flags, |
| 39 const std::wstring& message_text, | 39 const std::wstring& message_text, |
| 40 const std::wstring& default_prompt_text, | 40 const std::wstring& default_prompt_text, |
| 41 bool display_suppress_checkbox, | 41 bool display_suppress_checkbox, |
| 42 IPC::Message* reply_msg) | 42 IPC::Message* reply_msg) |
| 43 : web_contents_(web_contents), | 43 : web_contents_(web_contents), |
| 44 reply_msg_(reply_msg), | 44 reply_msg_(reply_msg), |
| 45 dialog_flags_(dialog_flags), | 45 dialog_flags_(dialog_flags), |
| 46 dialog_(NULL), | 46 dialog_(NULL), |
| 47 message_box_view_(new MessageBoxView(dialog_flags, message_text, | 47 message_box_view_(new MessageBoxView( |
| 48 default_prompt_text)) { | 48 dialog_flags | MessageBoxView::kAutoDetectAlignment, |
| 49 message_text, default_prompt_text)) { |
| 49 DCHECK(message_box_view_); | 50 DCHECK(message_box_view_); |
| 50 DCHECK(reply_msg_); | 51 DCHECK(reply_msg_); |
| 51 | 52 |
| 52 if (display_suppress_checkbox) { | 53 if (display_suppress_checkbox) { |
| 53 message_box_view_->SetCheckBoxLabel( | 54 message_box_view_->SetCheckBoxLabel( |
| 54 l10n_util::GetString(IDS_JAVASCRIPT_MESSAGEBOX_SUPPRESS_OPTION)); | 55 l10n_util::GetString(IDS_JAVASCRIPT_MESSAGEBOX_SUPPRESS_OPTION)); |
| 55 } | 56 } |
| 56 | 57 |
| 57 // Make sure we get navigation notifications so we know when our parent | 58 // Make sure we get navigation notifications so we know when our parent |
| 58 // contents will disappear or navigate to a different page. | 59 // contents will disappear or navigate to a different page. |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 web_contents_gone = true; | 202 web_contents_gone = true; |
| 202 | 203 |
| 203 if (web_contents_gone) { | 204 if (web_contents_gone) { |
| 204 web_contents_ = NULL; | 205 web_contents_ = NULL; |
| 205 | 206 |
| 206 // If the dialog is visible close it. | 207 // If the dialog is visible close it. |
| 207 if (dialog_) | 208 if (dialog_) |
| 208 dialog_->Close(); | 209 dialog_->Close(); |
| 209 } | 210 } |
| 210 } | 211 } |
| OLD | NEW |