 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/gtk/content_setting_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/content_setting_bubble_gtk.h" | 
| 6 | 6 | 
| 7 #include <set> | 7 #include <set> | 
| 8 #include <string> | 8 #include <string> | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| 11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" | 
| 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/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" | 
| 15 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 17 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 
| 16 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 18 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 
| 17 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 19 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 
| 18 #include "chrome/browser/ui/gtk/gtk_util.h" | 20 #include "chrome/browser/ui/gtk/gtk_util.h" | 
| 19 #include "chrome/common/content_settings.h" | 21 #include "chrome/common/content_settings.h" | 
| 20 #include "content/public/browser/notification_source.h" | 22 #include "content/public/browser/notification_source.h" | 
| 21 #include "content/public/browser/notification_types.h" | 23 #include "content/public/browser/notification_types.h" | 
| 22 #include "content/public/browser/plugin_service.h" | 24 #include "content/public/browser/plugin_service.h" | 
| 23 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" | 
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 GtkWidget* label = theme_provider->BuildLabel(content.title.c_str(), | 103 GtkWidget* label = theme_provider->BuildLabel(content.title.c_str(), | 
| 102 ui::kGdkBlack); | 104 ui::kGdkBlack); | 
| 103 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | 105 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | 
| 104 gtk_box_pack_start(GTK_BOX(bubble_content), label, FALSE, FALSE, 0); | 106 gtk_box_pack_start(GTK_BOX(bubble_content), label, FALSE, FALSE, 0); | 
| 105 } | 107 } | 
| 106 | 108 | 
| 107 const std::set<std::string>& plugins = content.resource_identifiers; | 109 const std::set<std::string>& plugins = content.resource_identifiers; | 
| 108 if (!plugins.empty()) { | 110 if (!plugins.empty()) { | 
| 109 GtkWidget* list_content = gtk_vbox_new(FALSE, ui::kControlSpacing); | 111 GtkWidget* list_content = gtk_vbox_new(FALSE, ui::kControlSpacing); | 
| 110 | 112 | 
| 113 PluginFinder* finder = PluginFinder::GetInstance(); | |
| 111 for (std::set<std::string>::const_iterator it = plugins.begin(); | 114 for (std::set<std::string>::const_iterator it = plugins.begin(); | 
| 112 it != plugins.end(); ++it) { | 115 it != plugins.end(); ++it) { | 
| 113 std::string name = UTF16ToUTF8( | 116 PluginMetadata* plugin = finder->FindPluginMetadataWithIdentifier(*it); | 
| 114 PluginService::GetInstance()->GetPluginGroupName(*it)); | 117 std::string name; | 
| 
Peter Kasting
2012/09/21 20:10:56
Nit: Or
      std::string name(plugin ? UTF16ToUT
 
ibraaaa
2012/09/24 11:42:29
Done.
 | |
| 118 if (plugin) | |
| 119 name = UTF16ToUTF8(plugin->name()); | |
| 115 if (name.empty()) | 120 if (name.empty()) | 
| 116 name = *it; | 121 name = *it; | 
| 117 | 122 | 
| 118 GtkWidget* label = theme_provider->BuildLabel( | 123 GtkWidget* label = theme_provider->BuildLabel( | 
| 119 BuildElidedText(name).c_str(), ui::kGdkBlack); | 124 BuildElidedText(name).c_str(), ui::kGdkBlack); | 
| 120 GtkWidget* label_box = gtk_hbox_new(FALSE, 0); | 125 GtkWidget* label_box = gtk_hbox_new(FALSE, 0); | 
| 121 gtk_box_pack_start(GTK_BOX(label_box), label, FALSE, FALSE, 0); | 126 gtk_box_pack_start(GTK_BOX(label_box), label, FALSE, FALSE, 0); | 
| 122 | 127 | 
| 123 gtk_box_pack_start(GTK_BOX(list_content), | 128 gtk_box_pack_start(GTK_BOX(list_content), | 
| 124 label_box, | 129 label_box, | 
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 | 320 | 
| 316 void ContentSettingBubbleGtk::OnCustomLinkClicked(GtkWidget* button) { | 321 void ContentSettingBubbleGtk::OnCustomLinkClicked(GtkWidget* button) { | 
| 317 content_setting_bubble_model_->OnCustomLinkClicked(); | 322 content_setting_bubble_model_->OnCustomLinkClicked(); | 
| 318 Close(); | 323 Close(); | 
| 319 } | 324 } | 
| 320 | 325 | 
| 321 void ContentSettingBubbleGtk::OnManageLinkClicked(GtkWidget* button) { | 326 void ContentSettingBubbleGtk::OnManageLinkClicked(GtkWidget* button) { | 
| 322 content_setting_bubble_model_->OnManageLinkClicked(); | 327 content_setting_bubble_model_->OnManageLinkClicked(); | 
| 323 Close(); | 328 Close(); | 
| 324 } | 329 } | 
| OLD | NEW |