Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Side by Side Diff: chrome/browser/ui/views/content_setting_bubble_contents.cc

Issue 2220573004: Caption for the Subresource filter bubble prompt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: xib Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, 195 column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1,
196 GridLayout::USE_PREF, 0, 0); 196 GridLayout::USE_PREF, 0, 0);
197 column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); 197 column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing);
198 column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, 198 column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1,
199 GridLayout::USE_PREF, 0, 0); 199 GridLayout::USE_PREF, 0, 0);
200 200
201 const ContentSettingBubbleModel::BubbleContent& bubble_content = 201 const ContentSettingBubbleModel::BubbleContent& bubble_content =
202 content_setting_bubble_model_->bubble_content(); 202 content_setting_bubble_model_->bubble_content();
203 bool bubble_content_empty = true; 203 bool bubble_content_empty = true;
204 204
205 if (!bubble_content.caption.empty()) {
206 views::Label* caption_label =
207 new views::Label(base::UTF8ToUTF16(bubble_content.caption));
208 caption_label->SetMultiLine(false);
msw 2016/08/09 19:46:54 Why not allow multi-line? Will this work alright f
melandory 2016/08/10 14:55:07 Done.
209 caption_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
210 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
211 caption_label->SetFontList(rb.GetFontList(ui::ResourceBundle::MediumFont));
212 layout->StartRow(0, kSingleColumnSetId);
213 layout->AddView(caption_label);
214 layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing);
215 bubble_content_empty = false;
216 }
217
205 if (!bubble_content.title.empty()) { 218 if (!bubble_content.title.empty()) {
206 views::Label* title_label = new views::Label(base::UTF8ToUTF16( 219 views::Label* title_label = new views::Label(base::UTF8ToUTF16(
207 bubble_content.title)); 220 bubble_content.title));
208 title_label->SetMultiLine(true); 221 title_label->SetMultiLine(true);
209 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 222 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
210 layout->StartRow(0, kSingleColumnSetId); 223 layout->StartRow(0, kSingleColumnSetId);
211 layout->AddView(title_label); 224 layout->AddView(title_label);
212 bubble_content_empty = false; 225 bubble_content_empty = false;
213 } 226 }
214 227
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 DCHECK(i != list_item_links_.end()); 449 DCHECK(i != list_item_links_.end());
437 content_setting_bubble_model_->OnListItemClicked(i->second); 450 content_setting_bubble_model_->OnListItemClicked(i->second);
438 } 451 }
439 452
440 void ContentSettingBubbleContents::OnPerformAction(views::Combobox* combobox) { 453 void ContentSettingBubbleContents::OnPerformAction(views::Combobox* combobox) {
441 MediaComboboxModel* model = 454 MediaComboboxModel* model =
442 static_cast<MediaComboboxModel*>(combobox->model()); 455 static_cast<MediaComboboxModel*>(combobox->model());
443 content_setting_bubble_model_->OnMediaMenuClicked( 456 content_setting_bubble_model_->OnMediaMenuClicked(
444 model->type(), model->GetDevices()[combobox->selected_index()].id); 457 model->type(), model->GetDevices()[combobox->selected_index()].id);
445 } 458 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698