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

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

Issue 799643004: 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "ui/web_dialogs/web_dialog_delegate.h" 44 #include "ui/web_dialogs/web_dialog_delegate.h"
45 45
46 using content::NavigationController; 46 using content::NavigationController;
47 using content::WebContents; 47 using content::WebContents;
48 using content::WebUIMessageHandler; 48 using content::WebUIMessageHandler;
49 49
50 namespace { 50 namespace {
51 51
52 void EnableInternalPDFPluginForContents(WebContents* preview_dialog) { 52 void EnableInternalPDFPluginForContents(WebContents* preview_dialog) {
53 // Always enable the internal PDF plugin for the print preview page. 53 // Always enable the internal PDF plugin for the print preview page.
54 base::FilePath pdf_plugin_path; 54 base::FilePath pdf_plugin_path = base::FilePath::FromUTF8Unsafe(
55 if (!PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_plugin_path)) 55 ChromeContentClient::kPDFPluginPath);
56 return;
57 56
58 content::WebPluginInfo pdf_plugin; 57 content::WebPluginInfo pdf_plugin;
59 if (!content::PluginService::GetInstance()->GetPluginInfoByPath( 58 if (!content::PluginService::GetInstance()->GetPluginInfoByPath(
60 pdf_plugin_path, &pdf_plugin)) 59 pdf_plugin_path, &pdf_plugin))
61 return; 60 return;
62 61
63 ChromePluginServiceFilter::GetInstance()->OverridePluginForFrame( 62 ChromePluginServiceFilter::GetInstance()->OverridePluginForFrame(
64 preview_dialog->GetRenderProcessHost()->GetID(), 63 preview_dialog->GetRenderProcessHost()->GetID(),
65 preview_dialog->GetMainFrame()->GetRoutingID(), 64 preview_dialog->GetMainFrame()->GetRoutingID(),
66 GURL(), pdf_plugin); 65 GURL(), pdf_plugin);
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 static_cast<PrintPreviewUI*>(web_ui->GetController()); 480 static_cast<PrintPreviewUI*>(web_ui->GetController());
482 if (print_preview_ui) 481 if (print_preview_ui)
483 print_preview_ui->OnPrintPreviewDialogDestroyed(); 482 print_preview_ui->OnPrintPreviewDialogDestroyed();
484 } 483 }
485 484
486 preview_dialog_map_.erase(preview_dialog); 485 preview_dialog_map_.erase(preview_dialog);
487 RemoveObservers(preview_dialog); 486 RemoveObservers(preview_dialog);
488 } 487 }
489 488
490 } // namespace printing 489 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698