| 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 "views/controls/message_box_view.h" | 5 #include "views/controls/message_box_view.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/message_box_flags.h" | 8 #include "app/message_box_flags.h" |
| 9 #include "base/clipboard.h" | 9 #include "base/clipboard.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 MessageBoxView::MessageBoxView(int dialog_flags, | 24 MessageBoxView::MessageBoxView(int dialog_flags, |
| 25 const std::wstring& message, | 25 const std::wstring& message, |
| 26 const std::wstring& default_prompt, | 26 const std::wstring& default_prompt, |
| 27 int message_width) | 27 int message_width) |
| 28 : message_label_(new views::Label(message)), | 28 : message_label_(new views::Label(message)), |
| 29 prompt_field_(NULL), | 29 prompt_field_(NULL), |
| 30 icon_(NULL), | 30 icon_(NULL), |
| 31 checkbox_(NULL), | 31 checkbox_(NULL), |
| 32 message_width_(message_width), | 32 message_width_(message_width), |
| 33 focus_grabber_factory_(this) { | 33 ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)) { |
| 34 Init(dialog_flags, default_prompt); | 34 Init(dialog_flags, default_prompt); |
| 35 } | 35 } |
| 36 | 36 |
| 37 MessageBoxView::MessageBoxView(int dialog_flags, | 37 MessageBoxView::MessageBoxView(int dialog_flags, |
| 38 const std::wstring& message, | 38 const std::wstring& message, |
| 39 const std::wstring& default_prompt) | 39 const std::wstring& default_prompt) |
| 40 : message_label_(new views::Label(message)), | 40 : message_label_(new views::Label(message)), |
| 41 prompt_field_(NULL), | 41 prompt_field_(NULL), |
| 42 icon_(NULL), | 42 icon_(NULL), |
| 43 checkbox_(NULL), | 43 checkbox_(NULL), |
| 44 message_width_(kDefaultMessageWidth), | 44 message_width_(kDefaultMessageWidth), |
| 45 focus_grabber_factory_(this) { | 45 ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)) { |
| 46 Init(dialog_flags, default_prompt); | 46 Init(dialog_flags, default_prompt); |
| 47 } | 47 } |
| 48 | 48 |
| 49 std::wstring MessageBoxView::GetInputText() { | 49 std::wstring MessageBoxView::GetInputText() { |
| 50 if (prompt_field_) | 50 if (prompt_field_) |
| 51 return prompt_field_->GetText(); | 51 return prompt_field_->GetText(); |
| 52 return EmptyWString(); | 52 return EmptyWString(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool MessageBoxView::IsCheckBoxSelected() { | 55 bool MessageBoxView::IsCheckBoxSelected() { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 203 } |
| 204 | 204 |
| 205 if (checkbox_) { | 205 if (checkbox_) { |
| 206 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 206 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 207 layout->StartRow(0, checkbox_column_view_set_id); | 207 layout->StartRow(0, checkbox_column_view_set_id); |
| 208 layout->AddView(checkbox_); | 208 layout->AddView(checkbox_); |
| 209 } | 209 } |
| 210 | 210 |
| 211 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 211 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 212 } | 212 } |
| OLD | NEW |