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/views/content_setting_bubble_contents.h" | 5 #include "chrome/browser/ui/views/content_setting_bubble_contents.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 if (!bubble_content.title.empty()) { | 205 if (!bubble_content.title.empty()) { |
206 views::Label* title_label = new views::Label(base::UTF8ToUTF16( | 206 views::Label* title_label = new views::Label(base::UTF8ToUTF16( |
207 bubble_content.title)); | 207 bubble_content.title)); |
208 title_label->SetMultiLine(true); | 208 title_label->SetMultiLine(true); |
209 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 209 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
210 layout->StartRow(0, kSingleColumnSetId); | 210 layout->StartRow(0, kSingleColumnSetId); |
211 layout->AddView(title_label); | 211 layout->AddView(title_label); |
212 bubble_content_empty = false; | 212 bubble_content_empty = false; |
213 } | 213 } |
214 | 214 |
| 215 if (!bubble_content.message.empty()) { |
| 216 views::Label* message_label = |
| 217 new views::Label(base::UTF8ToUTF16(bubble_content.message)); |
| 218 layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); |
| 219 message_label->SetMultiLine(true); |
| 220 message_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 221 layout->StartRow(0, kSingleColumnSetId); |
| 222 layout->AddView(message_label); |
| 223 bubble_content_empty = false; |
| 224 } |
| 225 |
215 if (!bubble_content.learn_more_link.empty()) { | 226 if (!bubble_content.learn_more_link.empty()) { |
216 learn_more_link_ = | 227 learn_more_link_ = |
217 new views::Link(base::UTF8ToUTF16(bubble_content.learn_more_link)); | 228 new views::Link(base::UTF8ToUTF16(bubble_content.learn_more_link)); |
218 learn_more_link_->set_listener(this); | 229 learn_more_link_->set_listener(this); |
219 learn_more_link_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 230 learn_more_link_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
220 layout->AddView(learn_more_link_); | 231 layout->AddView(learn_more_link_); |
221 bubble_content_empty = false; | 232 bubble_content_empty = false; |
222 } | 233 } |
223 | 234 |
224 // Layout for the item list (blocked plugins and popups). | 235 // Layout for the item list (blocked plugins and popups). |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 DCHECK(i != list_item_links_.end()); | 447 DCHECK(i != list_item_links_.end()); |
437 content_setting_bubble_model_->OnListItemClicked(i->second); | 448 content_setting_bubble_model_->OnListItemClicked(i->second); |
438 } | 449 } |
439 | 450 |
440 void ContentSettingBubbleContents::OnPerformAction(views::Combobox* combobox) { | 451 void ContentSettingBubbleContents::OnPerformAction(views::Combobox* combobox) { |
441 MediaComboboxModel* model = | 452 MediaComboboxModel* model = |
442 static_cast<MediaComboboxModel*>(combobox->model()); | 453 static_cast<MediaComboboxModel*>(combobox->model()); |
443 content_setting_bubble_model_->OnMediaMenuClicked( | 454 content_setting_bubble_model_->OnMediaMenuClicked( |
444 model->type(), model->GetDevices()[combobox->selected_index()].id); | 455 model->type(), model->GetDevices()[combobox->selected_index()].id); |
445 } | 456 } |
OLD | NEW |