| 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 22 matching lines...) Expand all Loading... |
| 33 #include "content/public/browser/navigation_details.h" | 33 #include "content/public/browser/navigation_details.h" |
| 34 #include "content/public/browser/navigation_entry.h" | 34 #include "content/public/browser/navigation_entry.h" |
| 35 #include "content/public/browser/notification_details.h" | 35 #include "content/public/browser/notification_details.h" |
| 36 #include "content/public/browser/notification_source.h" | 36 #include "content/public/browser/notification_source.h" |
| 37 #include "content/public/browser/plugin_service.h" | 37 #include "content/public/browser/plugin_service.h" |
| 38 #include "content/public/browser/render_process_host.h" | 38 #include "content/public/browser/render_process_host.h" |
| 39 #include "content/public/browser/render_view_host.h" | 39 #include "content/public/browser/render_view_host.h" |
| 40 #include "content/public/browser/web_contents.h" | 40 #include "content/public/browser/web_contents.h" |
| 41 #include "content/public/browser/web_contents_delegate.h" | 41 #include "content/public/browser/web_contents_delegate.h" |
| 42 #include "content/public/browser/web_contents_view.h" | 42 #include "content/public/browser/web_contents_view.h" |
| 43 #include "content/public/common/webplugininfo.h" |
| 43 #include "ui/web_dialogs/web_dialog_delegate.h" | 44 #include "ui/web_dialogs/web_dialog_delegate.h" |
| 44 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" | 45 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" |
| 45 #include "webkit/plugins/webplugininfo.h" | |
| 46 | 46 |
| 47 using content::NativeWebKeyboardEvent; | 47 using content::NativeWebKeyboardEvent; |
| 48 using content::NavigationController; | 48 using content::NavigationController; |
| 49 using content::WebContents; | 49 using content::WebContents; |
| 50 using content::WebUIMessageHandler; | 50 using content::WebUIMessageHandler; |
| 51 using ui::WebDialogDelegate; | 51 using ui::WebDialogDelegate; |
| 52 using ui::WebDialogWebContentsDelegate; | 52 using ui::WebDialogWebContentsDelegate; |
| 53 | 53 |
| 54 namespace { | 54 namespace { |
| 55 | 55 |
| 56 void EnableInternalPDFPluginForContents(WebContents* preview_dialog) { | 56 void EnableInternalPDFPluginForContents(WebContents* preview_dialog) { |
| 57 // Always enable the internal PDF plugin for the print preview page. | 57 // Always enable the internal PDF plugin for the print preview page. |
| 58 base::FilePath pdf_plugin_path; | 58 base::FilePath pdf_plugin_path; |
| 59 if (!PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_plugin_path)) | 59 if (!PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_plugin_path)) |
| 60 return; | 60 return; |
| 61 | 61 |
| 62 webkit::WebPluginInfo pdf_plugin; | 62 content::WebPluginInfo pdf_plugin; |
| 63 if (!content::PluginService::GetInstance()->GetPluginInfoByPath( | 63 if (!content::PluginService::GetInstance()->GetPluginInfoByPath( |
| 64 pdf_plugin_path, &pdf_plugin)) | 64 pdf_plugin_path, &pdf_plugin)) |
| 65 return; | 65 return; |
| 66 | 66 |
| 67 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( | 67 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( |
| 68 preview_dialog->GetRenderProcessHost()->GetID(), | 68 preview_dialog->GetRenderProcessHost()->GetID(), |
| 69 preview_dialog->GetRenderViewHost()->GetRoutingID(), | 69 preview_dialog->GetRenderViewHost()->GetRoutingID(), |
| 70 GURL(), pdf_plugin); | 70 GURL(), pdf_plugin); |
| 71 } | 71 } |
| 72 | 72 |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 PrintPreviewUI* print_preview_ui = | 516 PrintPreviewUI* print_preview_ui = |
| 517 static_cast<PrintPreviewUI*>(preview_dialog->GetWebUI()->GetController()); | 517 static_cast<PrintPreviewUI*>(preview_dialog->GetWebUI()->GetController()); |
| 518 if (print_preview_ui) | 518 if (print_preview_ui) |
| 519 print_preview_ui->OnPrintPreviewDialogDestroyed(); | 519 print_preview_ui->OnPrintPreviewDialogDestroyed(); |
| 520 | 520 |
| 521 preview_dialog_map_.erase(preview_dialog); | 521 preview_dialog_map_.erase(preview_dialog); |
| 522 RemoveObservers(preview_dialog, PREVIEW_DIALOG); | 522 RemoveObservers(preview_dialog, PREVIEW_DIALOG); |
| 523 } | 523 } |
| 524 | 524 |
| 525 } // namespace printing | 525 } // namespace printing |
| OLD | NEW |