OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/printing/print_preview_tab_controller.h" | 5 #include "chrome/browser/printing/print_preview_tab_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 PluginGroup* internal_pdf_group = NULL; | 45 PluginGroup* internal_pdf_group = NULL; |
46 std::vector<PluginGroup> plugin_groups; | 46 std::vector<PluginGroup> plugin_groups; |
47 PluginList::Singleton()->GetPluginGroups(false, &plugin_groups); | 47 PluginList::Singleton()->GetPluginGroups(false, &plugin_groups); |
48 for (size_t i = 0; i < plugin_groups.size(); ++i) { | 48 for (size_t i = 0; i < plugin_groups.size(); ++i) { |
49 if (plugin_groups[i].GetGroupName() == internal_pdf_group_name) { | 49 if (plugin_groups[i].GetGroupName() == internal_pdf_group_name) { |
50 internal_pdf_group = &plugin_groups[i]; | 50 internal_pdf_group = &plugin_groups[i]; |
51 break; | 51 break; |
52 } | 52 } |
53 } | 53 } |
54 if (internal_pdf_group) { | 54 if (internal_pdf_group) { |
55 std::vector<WebPluginInfo> plugins = internal_pdf_group->web_plugin_infos(); | 55 const std::vector<WebPluginInfo>& plugins = |
| 56 internal_pdf_group->web_plugin_infos(); |
56 DCHECK_EQ(plugins.size(), 1U); | 57 DCHECK_EQ(plugins.size(), 1U); |
57 | 58 |
58 webkit::WebPluginInfo plugin = plugins[0]; | 59 webkit::WebPluginInfo plugin = plugins[0]; |
59 plugin.enabled = WebPluginInfo::USER_ENABLED; | |
60 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( | 60 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( |
61 preview_tab->render_view_host()->process()->id(), | 61 preview_tab->render_view_host()->process()->id(), |
62 preview_tab->render_view_host()->routing_id(), | 62 preview_tab->render_view_host()->routing_id(), |
63 GURL(), | 63 GURL(), |
64 plugin); | 64 plugin); |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 void ResetPreviewTabOverrideTitle(TabContentsWrapper* preview_tab) { | 68 void ResetPreviewTabOverrideTitle(TabContentsWrapper* preview_tab) { |
69 preview_tab->print_view_manager()->ResetTitleOverride(); | 69 preview_tab->print_view_manager()->ResetTitleOverride(); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 RenderProcessHost* rph = tab->render_view_host()->process(); | 385 RenderProcessHost* rph = tab->render_view_host()->process(); |
386 if (registrar_.IsRegistered(this, | 386 if (registrar_.IsRegistered(this, |
387 content::NOTIFICATION_RENDERER_PROCESS_CLOSED, | 387 content::NOTIFICATION_RENDERER_PROCESS_CLOSED, |
388 Source<RenderProcessHost>(rph))) { | 388 Source<RenderProcessHost>(rph))) { |
389 registrar_.Remove(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, | 389 registrar_.Remove(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, |
390 Source<RenderProcessHost>(rph)); | 390 Source<RenderProcessHost>(rph)); |
391 } | 391 } |
392 } | 392 } |
393 | 393 |
394 } // namespace printing | 394 } // namespace printing |
OLD | NEW |