| OLD | NEW |
| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "content/public/browser/notification_details.h" | 34 #include "content/public/browser/notification_details.h" |
| 35 #include "content/public/browser/notification_source.h" | 35 #include "content/public/browser/notification_source.h" |
| 36 #include "content/public/browser/notification_types.h" | 36 #include "content/public/browser/notification_types.h" |
| 37 #include "webkit/plugins/webplugininfo.h" | 37 #include "webkit/plugins/webplugininfo.h" |
| 38 | 38 |
| 39 namespace { | 39 namespace { |
| 40 | 40 |
| 41 void EnableInternalPDFPluginForTab(TabContentsWrapper* preview_tab) { | 41 void EnableInternalPDFPluginForTab(TabContentsWrapper* preview_tab) { |
| 42 // Always enable the internal PDF plugin for the print preview page. | 42 // Always enable the internal PDF plugin for the print preview page. |
| 43 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( | 43 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( |
| 44 preview_tab->render_view_host()->process()->id(), | 44 preview_tab->render_view_host()->process()->GetID(), |
| 45 preview_tab->render_view_host()->routing_id(), | 45 preview_tab->render_view_host()->routing_id(), |
| 46 GURL(), | 46 GURL(), |
| 47 ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName)); | 47 ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 class PrintPreviewTabDelegate : public HtmlDialogUIDelegate { | 50 class PrintPreviewTabDelegate : public HtmlDialogUIDelegate { |
| 51 public: | 51 public: |
| 52 explicit PrintPreviewTabDelegate(TabContentsWrapper* initiator_tab); | 52 explicit PrintPreviewTabDelegate(TabContentsWrapper* initiator_tab); |
| 53 virtual ~PrintPreviewTabDelegate(); | 53 virtual ~PrintPreviewTabDelegate(); |
| 54 | 54 |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 PrintPreviewUI* print_preview_ui = | 461 PrintPreviewUI* print_preview_ui = |
| 462 static_cast<PrintPreviewUI*>(preview_tab->web_ui()); | 462 static_cast<PrintPreviewUI*>(preview_tab->web_ui()); |
| 463 if (print_preview_ui) | 463 if (print_preview_ui) |
| 464 print_preview_ui->OnTabDestroyed(); | 464 print_preview_ui->OnTabDestroyed(); |
| 465 | 465 |
| 466 preview_tab_map_.erase(preview_tab); | 466 preview_tab_map_.erase(preview_tab); |
| 467 RemoveObservers(preview_tab); | 467 RemoveObservers(preview_tab); |
| 468 } | 468 } |
| 469 | 469 |
| 470 } // namespace printing | 470 } // namespace printing |
| OLD | NEW |