 Chromium Code Reviews
 Chromium Code Reviews Issue 10917189:
  Remove PluginFinder async interface  (Closed) 
  Base URL: http://git.chromium.org/chromium/src.git@separate_finder_thread_safety
    
  
    Issue 10917189:
  Remove PluginFinder async interface  (Closed) 
  Base URL: http://git.chromium.org/chromium/src.git@separate_finder_thread_safety| 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 PluginMetadata* plugin = finder->FindPluginMetadataWithIdentifier(*i); | 
| 161 string16 name; | |
| 
Peter Kasting
2012/09/21 20:10:56
Nit: See comment in GTK
 
ibraaaa
2012/09/24 11:42:29
Done.
 | |
| 162 if (plugin) | |
| 163 name = plugin->name(); | |
| 158 if (name.empty()) | 164 if (name.empty()) | 
| 159 name = UTF8ToUTF16(*i); | 165 name = UTF8ToUTF16(*i); | 
| 160 layout->StartRow(0, single_column_set_id); | 166 layout->StartRow(0, single_column_set_id); | 
| 161 layout->AddView(new views::Label(name)); | 167 layout->AddView(new views::Label(name)); | 
| 162 bubble_content_empty = false; | 168 bubble_content_empty = false; | 
| 163 } | 169 } | 
| 164 } | 170 } | 
| 165 | 171 | 
| 166 if (content_setting_bubble_model_->content_type() == | 172 if (content_setting_bubble_model_->content_type() == | 
| 167 CONTENT_SETTINGS_TYPE_POPUPS) { | 173 CONTENT_SETTINGS_TYPE_POPUPS) { | 
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 318 } | 324 } | 
| 319 | 325 | 
| 320 void ContentSettingBubbleContents::Observe( | 326 void ContentSettingBubbleContents::Observe( | 
| 321 int type, | 327 int type, | 
| 322 const content::NotificationSource& source, | 328 const content::NotificationSource& source, | 
| 323 const content::NotificationDetails& details) { | 329 const content::NotificationDetails& details) { | 
| 324 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); | 330 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); | 
| 325 DCHECK(source == content::Source<WebContents>(web_contents_)); | 331 DCHECK(source == content::Source<WebContents>(web_contents_)); | 
| 326 web_contents_ = NULL; | 332 web_contents_ = NULL; | 
| 327 } | 333 } | 
| OLD | NEW |