| 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> | 
| 11 | 11 | 
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" | 
| 13 #include "chrome/browser/content_settings/host_content_settings_map.h" | 13 #include "chrome/browser/content_settings/host_content_settings_map.h" | 
|  | 14 #include "chrome/browser/plugins/plugin_finder.h" | 
|  | 15 #include "chrome/browser/plugins/plugin_metadata.h" | 
| 14 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 16 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 
| 15 #include "chrome/browser/ui/views/browser_dialogs.h" | 17 #include "chrome/browser/ui/views/browser_dialogs.h" | 
| 16 #include "content/public/browser/notification_source.h" | 18 #include "content/public/browser/notification_source.h" | 
| 17 #include "content/public/browser/notification_types.h" | 19 #include "content/public/browser/notification_types.h" | 
| 18 #include "content/public/browser/plugin_service.h" | 20 #include "content/public/browser/plugin_service.h" | 
| 19 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" | 
| 20 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" | 
| 21 #include "ui/views/controls/button/radio_button.h" | 23 #include "ui/views/controls/button/radio_button.h" | 
| 22 #include "ui/views/controls/button/text_button.h" | 24 #include "ui/views/controls/button/text_button.h" | 
| 23 #include "ui/views/controls/image_view.h" | 25 #include "ui/views/controls/image_view.h" | 
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 145         bubble_content.title)); | 147         bubble_content.title)); | 
| 146     layout->StartRow(0, single_column_set_id); | 148     layout->StartRow(0, single_column_set_id); | 
| 147     layout->AddView(title_label); | 149     layout->AddView(title_label); | 
| 148     bubble_content_empty = false; | 150     bubble_content_empty = false; | 
| 149   } | 151   } | 
| 150 | 152 | 
| 151   const std::set<std::string>& plugins = bubble_content.resource_identifiers; | 153   const std::set<std::string>& plugins = bubble_content.resource_identifiers; | 
| 152   if (!plugins.empty()) { | 154   if (!plugins.empty()) { | 
| 153     if (!bubble_content_empty) | 155     if (!bubble_content_empty) | 
| 154       layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 156       layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 
|  | 157     PluginFinder* finder = PluginFinder::GetInstance(); | 
| 155     for (std::set<std::string>::const_iterator i(plugins.begin()); | 158     for (std::set<std::string>::const_iterator i(plugins.begin()); | 
| 156          i != plugins.end(); ++i) { | 159          i != plugins.end(); ++i) { | 
| 157       string16 name = PluginService::GetInstance()->GetPluginGroupName(*i); | 160       string16 name = finder->FindPluginNameWithIdentifier(*i); | 
| 158       if (name.empty()) |  | 
| 159         name = UTF8ToUTF16(*i); |  | 
| 160       layout->StartRow(0, single_column_set_id); | 161       layout->StartRow(0, single_column_set_id); | 
| 161       layout->AddView(new views::Label(name)); | 162       layout->AddView(new views::Label(name)); | 
| 162       bubble_content_empty = false; | 163       bubble_content_empty = false; | 
| 163     } | 164     } | 
| 164   } | 165   } | 
| 165 | 166 | 
| 166   if (content_setting_bubble_model_->content_type() == | 167   if (content_setting_bubble_model_->content_type() == | 
| 167       CONTENT_SETTINGS_TYPE_POPUPS) { | 168       CONTENT_SETTINGS_TYPE_POPUPS) { | 
| 168     const int popup_column_set_id = 2; | 169     const int popup_column_set_id = 2; | 
| 169     views::ColumnSet* popup_column_set = | 170     views::ColumnSet* popup_column_set = | 
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 318 } | 319 } | 
| 319 | 320 | 
| 320 void ContentSettingBubbleContents::Observe( | 321 void ContentSettingBubbleContents::Observe( | 
| 321     int type, | 322     int type, | 
| 322     const content::NotificationSource& source, | 323     const content::NotificationSource& source, | 
| 323     const content::NotificationDetails& details) { | 324     const content::NotificationDetails& details) { | 
| 324   DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); | 325   DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); | 
| 325   DCHECK(source == content::Source<WebContents>(web_contents_)); | 326   DCHECK(source == content::Source<WebContents>(web_contents_)); | 
| 326   web_contents_ = NULL; | 327   web_contents_ = NULL; | 
| 327 } | 328 } | 
| OLD | NEW | 
|---|