| 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/simple_message_box.h" | 5 #include "chrome/browser/ui/simple_message_box.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 if (yes_text_.empty()) { | 99 if (yes_text_.empty()) { |
| 100 yes_text_ = | 100 yes_text_ = |
| 101 type_ == MESSAGE_BOX_TYPE_QUESTION | 101 type_ == MESSAGE_BOX_TYPE_QUESTION |
| 102 ? l10n_util::GetStringUTF16(IDS_CONFIRM_MESSAGEBOX_YES_BUTTON_LABEL) | 102 ? l10n_util::GetStringUTF16(IDS_CONFIRM_MESSAGEBOX_YES_BUTTON_LABEL) |
| 103 : l10n_util::GetStringUTF16(IDS_OK); | 103 : l10n_util::GetStringUTF16(IDS_OK); |
| 104 } | 104 } |
| 105 | 105 |
| 106 if (no_text_.empty() && type_ == MESSAGE_BOX_TYPE_QUESTION) | 106 if (no_text_.empty() && type_ == MESSAGE_BOX_TYPE_QUESTION) |
| 107 no_text_ = l10n_util::GetStringUTF16(IDS_CANCEL); | 107 no_text_ = l10n_util::GetStringUTF16(IDS_CANCEL); |
| 108 | 108 |
| 109 if (!checkbox_text.empty()) { | 109 if (!checkbox_text.empty()) |
| 110 message_box_view_->SetCheckBoxLabel(checkbox_text); | 110 message_box_view_->SetCheckBoxLabel(checkbox_text); |
| 111 message_box_view_->SetCheckBoxSelected(true); | |
| 112 } | |
| 113 chrome::RecordDialogCreation(chrome::DialogIdentifier::SIMPLE_MESSAGE_BOX); | 111 chrome::RecordDialogCreation(chrome::DialogIdentifier::SIMPLE_MESSAGE_BOX); |
| 114 } | 112 } |
| 115 | 113 |
| 116 SimpleMessageBoxViews::~SimpleMessageBoxViews() { | 114 SimpleMessageBoxViews::~SimpleMessageBoxViews() { |
| 117 } | 115 } |
| 118 | 116 |
| 119 MessageBoxResult SimpleMessageBoxViews::RunDialogAndGetResult() { | 117 MessageBoxResult SimpleMessageBoxViews::RunDialogAndGetResult() { |
| 120 g_current_message_box = this; | 118 g_current_message_box = this; |
| 121 MessageBoxResult result = MESSAGE_BOX_RESULT_NO; | 119 MessageBoxResult result = MESSAGE_BOX_RESULT_NO; |
| 122 result_ = &result; | 120 result_ = &result; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 MessageBoxResult ShowMessageBoxWithButtonText(gfx::NativeWindow parent, | 290 MessageBoxResult ShowMessageBoxWithButtonText(gfx::NativeWindow parent, |
| 293 const base::string16& title, | 291 const base::string16& title, |
| 294 const base::string16& message, | 292 const base::string16& message, |
| 295 const base::string16& yes_text, | 293 const base::string16& yes_text, |
| 296 const base::string16& no_text) { | 294 const base::string16& no_text) { |
| 297 return ShowMessageBoxImpl(parent, title, message, MESSAGE_BOX_TYPE_QUESTION, | 295 return ShowMessageBoxImpl(parent, title, message, MESSAGE_BOX_TYPE_QUESTION, |
| 298 yes_text, no_text, base::string16()); | 296 yes_text, no_text, base::string16()); |
| 299 } | 297 } |
| 300 | 298 |
| 301 } // namespace chrome | 299 } // namespace chrome |
| OLD | NEW |