| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 MessageBoxView::~MessageBoxView() {} | 84 MessageBoxView::~MessageBoxView() {} |
| 85 | 85 |
| 86 string16 MessageBoxView::GetInputText() { | 86 string16 MessageBoxView::GetInputText() { |
| 87 return prompt_field_ ? prompt_field_->text() : string16(); | 87 return prompt_field_ ? prompt_field_->text() : string16(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 bool MessageBoxView::IsCheckBoxSelected() { | 90 bool MessageBoxView::IsCheckBoxSelected() { |
| 91 return checkbox_ ? checkbox_->checked() : false; | 91 return checkbox_ ? checkbox_->checked() : false; |
| 92 } | 92 } |
| 93 | 93 |
| 94 void MessageBoxView::SetIcon(const SkBitmap& icon) { | 94 void MessageBoxView::SetIcon(const gfx::ImageSkia& icon) { |
| 95 if (!icon_) | 95 if (!icon_) |
| 96 icon_ = new ImageView(); | 96 icon_ = new ImageView(); |
| 97 icon_->SetImage(icon); | 97 icon_->SetImage(icon); |
| 98 icon_->SetBounds(0, 0, icon.width(), icon.height()); | 98 icon_->SetBounds(0, 0, icon.width(), icon.height()); |
| 99 ResetLayoutManager(); | 99 ResetLayoutManager(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void MessageBoxView::SetCheckBoxLabel(const string16& label) { | 102 void MessageBoxView::SetCheckBoxLabel(const string16& label) { |
| 103 if (!checkbox_) | 103 if (!checkbox_) |
| 104 checkbox_ = new Checkbox(label); | 104 checkbox_ = new Checkbox(label); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 if (checkbox_) { | 261 if (checkbox_) { |
| 262 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 262 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 263 layout->StartRow(0, checkbox_column_view_set_id); | 263 layout->StartRow(0, checkbox_column_view_set_id); |
| 264 layout->AddView(checkbox_); | 264 layout->AddView(checkbox_); |
| 265 } | 265 } |
| 266 | 266 |
| 267 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 267 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace views | 270 } // namespace views |
| OLD | NEW |