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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, | 194 column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, |
195 GridLayout::USE_PREF, 0, 0); | 195 GridLayout::USE_PREF, 0, 0); |
196 | 196 |
197 const ContentSettingBubbleModel::BubbleContent& bubble_content = | 197 const ContentSettingBubbleModel::BubbleContent& bubble_content = |
198 content_setting_bubble_model_->bubble_content(); | 198 content_setting_bubble_model_->bubble_content(); |
199 bool bubble_content_empty = true; | 199 bool bubble_content_empty = true; |
200 | 200 |
201 if (!bubble_content.title.empty()) { | 201 if (!bubble_content.title.empty()) { |
202 views::Label* title_label = new views::Label(UTF8ToUTF16( | 202 views::Label* title_label = new views::Label(UTF8ToUTF16( |
203 bubble_content.title)); | 203 bubble_content.title)); |
| 204 title_label->SetMultiLine(true); |
| 205 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
204 layout->StartRow(0, kSingleColumnSetId); | 206 layout->StartRow(0, kSingleColumnSetId); |
205 layout->AddView(title_label); | 207 layout->AddView(title_label); |
206 bubble_content_empty = false; | 208 bubble_content_empty = false; |
207 } | 209 } |
208 | 210 |
209 const std::set<std::string>& plugins = bubble_content.resource_identifiers; | 211 const std::set<std::string>& plugins = bubble_content.resource_identifiers; |
210 if (!plugins.empty()) { | 212 if (!plugins.empty()) { |
211 if (!bubble_content_empty) | 213 if (!bubble_content_empty) |
212 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 214 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
213 PluginFinder* finder = PluginFinder::GetInstance(); | 215 PluginFinder* finder = PluginFinder::GetInstance(); |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 int width = button->GetPreferredSize().width(); | 484 int width = button->GetPreferredSize().width(); |
483 for (int i = 0; i < menu_model->GetItemCount(); ++i) { | 485 for (int i = 0; i < menu_model->GetItemCount(); ++i) { |
484 button->SetText(menu_model->GetLabelAt(i)); | 486 button->SetText(menu_model->GetLabelAt(i)); |
485 width = std::max(width, button->GetPreferredSize().width()); | 487 width = std::max(width, button->GetPreferredSize().width()); |
486 } | 488 } |
487 | 489 |
488 // Recover the title for the menu button. | 490 // Recover the title for the menu button. |
489 button->SetText(title); | 491 button->SetText(title); |
490 return width; | 492 return width; |
491 } | 493 } |
OLD | NEW |