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

Side by Side Diff: chrome/browser/printing/print_preview_tab_controller.cc

Issue 7848025: Store plug-in enabled/disabled state in PluginPrefs instead of WebPluginInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/plugin_prefs_unittest.cc ('k') | chrome/browser/ui/webui/plugins_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/plugin_prefs_unittest.cc ('k') | chrome/browser/ui/webui/plugins_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698