OLD | NEW |
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 Loading... |
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; | 55 base::FilePath pdf_plugin_path = base::FilePath::FromUTF8Unsafe( |
56 if (!PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_plugin_path)) | 56 ChromeContentClient::kPDFPluginPath); |
57 return; | |
58 | 57 |
59 content::WebPluginInfo pdf_plugin; | 58 content::WebPluginInfo pdf_plugin; |
60 if (!content::PluginService::GetInstance()->GetPluginInfoByPath( | 59 if (!content::PluginService::GetInstance()->GetPluginInfoByPath( |
61 pdf_plugin_path, &pdf_plugin)) | 60 pdf_plugin_path, &pdf_plugin)) |
62 return; | 61 return; |
63 | 62 |
64 ChromePluginServiceFilter::GetInstance()->OverridePluginForFrame( | 63 ChromePluginServiceFilter::GetInstance()->OverridePluginForFrame( |
65 preview_dialog->GetRenderProcessHost()->GetID(), | 64 preview_dialog->GetRenderProcessHost()->GetID(), |
66 preview_dialog->GetMainFrame()->GetRoutingID(), | 65 preview_dialog->GetMainFrame()->GetRoutingID(), |
67 GURL(), pdf_plugin); | 66 GURL(), pdf_plugin); |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 static_cast<PrintPreviewUI*>(web_ui->GetController()); | 488 static_cast<PrintPreviewUI*>(web_ui->GetController()); |
490 if (print_preview_ui) | 489 if (print_preview_ui) |
491 print_preview_ui->OnPrintPreviewDialogDestroyed(); | 490 print_preview_ui->OnPrintPreviewDialogDestroyed(); |
492 } | 491 } |
493 | 492 |
494 preview_dialog_map_.erase(preview_dialog); | 493 preview_dialog_map_.erase(preview_dialog); |
495 RemoveObservers(preview_dialog); | 494 RemoveObservers(preview_dialog); |
496 } | 495 } |
497 | 496 |
498 } // namespace printing | 497 } // namespace printing |
OLD | NEW |