| 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 "ui/views/controls/message_box_view.h" | 5 #include "ui/views/controls/message_box_view.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 r->push_back(last); | 89 r->push_back(last); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace | 92 } // namespace |
| 93 | 93 |
| 94 namespace views { | 94 namespace views { |
| 95 | 95 |
| 96 /////////////////////////////////////////////////////////////////////////////// | 96 /////////////////////////////////////////////////////////////////////////////// |
| 97 // MessageBoxView, public: | 97 // MessageBoxView, public: |
| 98 | 98 |
| 99 MessageBoxView::MessageBoxView(const string16& message) |
| 100 : prompt_field_(NULL), |
| 101 icon_(NULL), |
| 102 checkbox_(NULL), |
| 103 message_width_(kDefaultMessageWidth) { |
| 104 Init(NO_OPTIONS, message, string16()); |
| 105 } |
| 106 |
| 107 MessageBoxView::MessageBoxView(int options, |
| 108 const string16& message, |
| 109 const string16& default_prompt) |
| 110 : prompt_field_(NULL), |
| 111 icon_(NULL), |
| 112 checkbox_(NULL), |
| 113 message_width_(kDefaultMessageWidth) { |
| 114 Init(options, message, default_prompt); |
| 115 } |
| 116 |
| 99 MessageBoxView::MessageBoxView(int options, | 117 MessageBoxView::MessageBoxView(int options, |
| 100 const string16& message, | 118 const string16& message, |
| 101 const string16& default_prompt, | 119 const string16& default_prompt, |
| 102 int message_width) | 120 int message_width) |
| 103 : prompt_field_(NULL), | 121 : prompt_field_(NULL), |
| 104 icon_(NULL), | 122 icon_(NULL), |
| 105 checkbox_(NULL), | 123 checkbox_(NULL), |
| 106 message_width_(message_width) { | 124 message_width_(message_width) { |
| 107 Init(options, message, default_prompt); | 125 Init(options, message, default_prompt); |
| 108 } | 126 } |
| 109 | 127 |
| 110 MessageBoxView::MessageBoxView(int options, | |
| 111 const string16& message, | |
| 112 const string16& default_prompt) | |
| 113 : prompt_field_(NULL), | |
| 114 icon_(NULL), | |
| 115 checkbox_(NULL), | |
| 116 message_width_(kDefaultMessageWidth) { | |
| 117 Init(options, message, default_prompt); | |
| 118 } | |
| 119 | |
| 120 MessageBoxView::~MessageBoxView() {} | 128 MessageBoxView::~MessageBoxView() {} |
| 121 | 129 |
| 122 string16 MessageBoxView::GetInputText() { | 130 string16 MessageBoxView::GetInputText() { |
| 123 return prompt_field_ ? prompt_field_->text() : string16(); | 131 return prompt_field_ ? prompt_field_->text() : string16(); |
| 124 } | 132 } |
| 125 | 133 |
| 126 bool MessageBoxView::IsCheckBoxSelected() { | 134 bool MessageBoxView::IsCheckBoxSelected() { |
| 127 return checkbox_ ? checkbox_->checked() : false; | 135 return checkbox_ ? checkbox_->checked() : false; |
| 128 } | 136 } |
| 129 | 137 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 if (checkbox_) { | 305 if (checkbox_) { |
| 298 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 306 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 299 layout->StartRow(0, checkbox_column_view_set_id); | 307 layout->StartRow(0, checkbox_column_view_set_id); |
| 300 layout->AddView(checkbox_); | 308 layout->AddView(checkbox_); |
| 301 } | 309 } |
| 302 | 310 |
| 303 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 311 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 304 } | 312 } |
| 305 | 313 |
| 306 } // namespace views | 314 } // namespace views |
| OLD | NEW |