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

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

Issue 5516004: Clean up PluginGroup and related code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/views/content_setting_bubble_contents.h" 5 #include "chrome/browser/views/content_setting_bubble_contents.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gdk/gdk.h> 8 #include <gdk/gdk.h>
9 #endif 9 #endif
10 10
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 bubble_content.title)); 222 bubble_content.title));
223 layout->StartRow(0, single_column_set_id); 223 layout->StartRow(0, single_column_set_id);
224 layout->AddView(title_label); 224 layout->AddView(title_label);
225 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); 225 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
226 } 226 }
227 227
228 const std::set<std::string>& plugins = bubble_content.resource_identifiers; 228 const std::set<std::string>& plugins = bubble_content.resource_identifiers;
229 if (!plugins.empty()) { 229 if (!plugins.empty()) {
230 for (std::set<std::string>::const_iterator it = plugins.begin(); 230 for (std::set<std::string>::const_iterator it = plugins.begin();
231 it != plugins.end(); ++it) { 231 it != plugins.end(); ++it) {
232 std::wstring name; 232 std::wstring name = UTF16ToWide(
233 NPAPI::PluginList::PluginMap groups; 233 NPAPI::PluginList::Singleton()->GetPluginGroupName(*it));
234 NPAPI::PluginList::Singleton()->GetPluginGroups(false, &groups); 234 if (name.empty())
235 if (groups.find(*it) != groups.end())
236 name = UTF16ToWide(groups[*it]->GetGroupName());
237 else
238 name = UTF8ToWide(*it); 235 name = UTF8ToWide(*it);
239 layout->StartRow(0, single_column_set_id); 236 layout->StartRow(0, single_column_set_id);
240 layout->AddView(new views::Label(name)); 237 layout->AddView(new views::Label(name));
241 } 238 }
242 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); 239 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
243 } 240 }
244 241
245 if (content_setting_bubble_model_->content_type() == 242 if (content_setting_bubble_model_->content_type() ==
246 CONTENT_SETTINGS_TYPE_POPUPS) { 243 CONTENT_SETTINGS_TYPE_POPUPS) {
247 const int popup_column_set_id = 2; 244 const int popup_column_set_id = 2;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 371
375 layout->StartRow(0, double_column_set_id); 372 layout->StartRow(0, double_column_set_id);
376 manage_link_ = new views::Link(UTF8ToWide(bubble_content.manage_link)); 373 manage_link_ = new views::Link(UTF8ToWide(bubble_content.manage_link));
377 manage_link_->SetController(this); 374 manage_link_->SetController(this);
378 layout->AddView(manage_link_); 375 layout->AddView(manage_link_);
379 376
380 close_button_ = 377 close_button_ =
381 new views::NativeButton(this, l10n_util::GetString(IDS_DONE)); 378 new views::NativeButton(this, l10n_util::GetString(IDS_DONE));
382 layout->AddView(close_button_); 379 layout->AddView(close_button_);
383 } 380 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698