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

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

Issue 777103002: Add the names of plugins to the blocked plugin bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use group_name instead of plugin.name Created 6 years 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 if (!bubble_content.learn_more_link.empty()) { 205 if (!bubble_content.learn_more_link.empty()) {
206 learn_more_link_ = 206 learn_more_link_ =
207 new views::Link(base::UTF8ToUTF16(bubble_content.learn_more_link)); 207 new views::Link(base::UTF8ToUTF16(bubble_content.learn_more_link));
208 learn_more_link_->set_listener(this); 208 learn_more_link_->set_listener(this);
209 learn_more_link_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 209 learn_more_link_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
210 layout->AddView(learn_more_link_); 210 layout->AddView(learn_more_link_);
211 bubble_content_empty = false; 211 bubble_content_empty = false;
212 } 212 }
213 213
214 if (!bubble_content.plugin_names.empty()) {
215 const int kPluginsColumnSetId = 4;
216 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
217 views::ColumnSet* plugins_column_set =
218 layout->AddColumnSet(kPluginsColumnSetId);
219 plugins_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1,
220 GridLayout::USE_PREF, 0, 0);
221 plugins_column_set->AddPaddingColumn(
222 0, views::kRelatedControlHorizontalSpacing);
223 plugins_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1,
224 GridLayout::USE_PREF, 0, 0);
225
226 views::Label* plugin_names_label =
227 new views::Label(bubble_content.plugin_names);
228 plugin_names_label->SetMultiLine(true);
229 plugin_names_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
230 layout->StartRow(0, kPluginsColumnSetId);
231 layout->AddView(plugin_names_label);
232 bubble_content_empty = false;
233 }
234
214 if (content_setting_bubble_model_->content_type() == 235 if (content_setting_bubble_model_->content_type() ==
215 CONTENT_SETTINGS_TYPE_POPUPS) { 236 CONTENT_SETTINGS_TYPE_POPUPS) {
216 const int kPopupColumnSetId = 2; 237 const int kPopupColumnSetId = 2;
217 views::ColumnSet* popup_column_set = 238 views::ColumnSet* popup_column_set =
218 layout->AddColumnSet(kPopupColumnSetId); 239 layout->AddColumnSet(kPopupColumnSetId);
219 popup_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 0, 240 popup_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 0,
220 GridLayout::USE_PREF, 0, 0); 241 GridLayout::USE_PREF, 0, 0);
221 popup_column_set->AddPaddingColumn( 242 popup_column_set->AddPaddingColumn(
222 0, views::kRelatedControlHorizontalSpacing); 243 0, views::kRelatedControlHorizontalSpacing);
223 popup_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, 244 popup_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1,
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 // Make sure the width is at least kMinMediaMenuButtonWidth. The 513 // Make sure the width is at least kMinMediaMenuButtonWidth. The
493 // maximum width will be clamped by kMaxContentsWidth of the view. 514 // maximum width will be clamped by kMaxContentsWidth of the view.
494 menu_width = std::max(kMinMediaMenuButtonWidth, menu_width + margins); 515 menu_width = std::max(kMinMediaMenuButtonWidth, menu_width + margins);
495 516
496 for (MediaMenuPartsMap::const_iterator i = media_menus_.begin(); 517 for (MediaMenuPartsMap::const_iterator i = media_menus_.begin();
497 i != media_menus_.end(); ++i) { 518 i != media_menus_.end(); ++i) {
498 i->first->SetMinSize(gfx::Size(menu_width, 0)); 519 i->first->SetMinSize(gfx::Size(menu_width, 0));
499 i->first->SetMaxSize(gfx::Size(menu_width, 0)); 520 i->first->SetMaxSize(gfx::Size(menu_width, 0));
500 } 521 }
501 } 522 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698