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

Unified Diff: chrome/browser/printing/print_preview_tab_controller.cc

Issue 7977042: Get rid of synchronous calls to getting plugins to help with http://codereview.chromium.org/79800... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/plugin_exceptions_table_model_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_preview_tab_controller.cc
===================================================================
--- chrome/browser/printing/print_preview_tab_controller.cc (revision 102144)
+++ chrome/browser/printing/print_preview_tab_controller.cc (working copy)
@@ -28,41 +28,17 @@
#include "content/common/content_notification_types.h"
#include "content/common/notification_details.h"
#include "content/common/notification_source.h"
-#include "webkit/plugins/npapi/plugin_group.h"
-#include "webkit/plugins/npapi/plugin_list.h"
#include "webkit/plugins/webplugininfo.h"
-using webkit::npapi::PluginGroup;
-using webkit::npapi::PluginList;
-using webkit::WebPluginInfo;
-
namespace {
void EnableInternalPDFPluginForTab(TabContentsWrapper* preview_tab) {
// Always enable the internal PDF plugin for the print preview page.
- string16 internal_pdf_group_name(
- ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName));
- PluginGroup* internal_pdf_group = NULL;
- std::vector<PluginGroup> plugin_groups;
- PluginList::Singleton()->GetPluginGroups(false, &plugin_groups);
- for (size_t i = 0; i < plugin_groups.size(); ++i) {
- if (plugin_groups[i].GetGroupName() == internal_pdf_group_name) {
- internal_pdf_group = &plugin_groups[i];
- break;
- }
- }
- if (internal_pdf_group) {
- const std::vector<WebPluginInfo>& plugins =
- internal_pdf_group->web_plugin_infos();
- DCHECK_EQ(plugins.size(), 1U);
-
- webkit::WebPluginInfo plugin = plugins[0];
- ChromePluginServiceFilter::GetInstance()->OverridePluginForTab(
+ ChromePluginServiceFilter::GetInstance()->OverridePluginForTab(
preview_tab->render_view_host()->process()->id(),
preview_tab->render_view_host()->routing_id(),
GURL(),
- plugin);
- }
+ ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName));
}
void ResetPreviewTabOverrideTitle(TabContentsWrapper* preview_tab) {
« no previous file with comments | « chrome/browser/plugin_exceptions_table_model_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698