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

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

Issue 899033002: Revert of Combine PDF plugin into the Chromium binary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
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/printing/print_preview_dialog_controller.h" 5 #include "chrome/browser/printing/print_preview_dialog_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "ui/web_dialogs/web_dialog_delegate.h" 45 #include "ui/web_dialogs/web_dialog_delegate.h"
46 46
47 using content::NavigationController; 47 using content::NavigationController;
48 using content::WebContents; 48 using content::WebContents;
49 using content::WebUIMessageHandler; 49 using content::WebUIMessageHandler;
50 50
51 namespace { 51 namespace {
52 52
53 void EnableInternalPDFPluginForContents(WebContents* preview_dialog) { 53 void EnableInternalPDFPluginForContents(WebContents* preview_dialog) {
54 // Always enable the internal PDF plugin for the print preview page. 54 // Always enable the internal PDF plugin for the print preview page.
55 base::FilePath pdf_plugin_path = base::FilePath::FromUTF8Unsafe( 55 base::FilePath pdf_plugin_path;
56 ChromeContentClient::kPDFPluginPath); 56 if (!PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_plugin_path))
57 return;
57 58
58 content::WebPluginInfo pdf_plugin; 59 content::WebPluginInfo pdf_plugin;
59 if (!content::PluginService::GetInstance()->GetPluginInfoByPath( 60 if (!content::PluginService::GetInstance()->GetPluginInfoByPath(
60 pdf_plugin_path, &pdf_plugin)) 61 pdf_plugin_path, &pdf_plugin))
61 return; 62 return;
62 63
63 ChromePluginServiceFilter::GetInstance()->OverridePluginForFrame( 64 ChromePluginServiceFilter::GetInstance()->OverridePluginForFrame(
64 preview_dialog->GetRenderProcessHost()->GetID(), 65 preview_dialog->GetRenderProcessHost()->GetID(),
65 preview_dialog->GetMainFrame()->GetRoutingID(), 66 preview_dialog->GetMainFrame()->GetRoutingID(),
66 GURL(), pdf_plugin); 67 GURL(), pdf_plugin);
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 static_cast<PrintPreviewUI*>(web_ui->GetController()); 489 static_cast<PrintPreviewUI*>(web_ui->GetController());
489 if (print_preview_ui) 490 if (print_preview_ui)
490 print_preview_ui->OnPrintPreviewDialogDestroyed(); 491 print_preview_ui->OnPrintPreviewDialogDestroyed();
491 } 492 }
492 493
493 preview_dialog_map_.erase(preview_dialog); 494 preview_dialog_map_.erase(preview_dialog);
494 RemoveObservers(preview_dialog); 495 RemoveObservers(preview_dialog);
495 } 496 }
496 497
497 } // namespace printing 498 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/extensions/component_loader.cc ('k') | chrome/browser/printing/print_preview_pdf_generated_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698