| 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 20 matching lines...) Expand all Loading... |
| 31 #include "content/browser/renderer_host/render_view_host.h" | 31 #include "content/browser/renderer_host/render_view_host.h" |
| 32 #include "content/browser/tab_contents/tab_contents.h" | 32 #include "content/browser/tab_contents/tab_contents.h" |
| 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/notification_types.h" | 37 #include "content/public/browser/notification_types.h" |
| 38 #include "webkit/plugins/webplugininfo.h" | 38 #include "webkit/plugins/webplugininfo.h" |
| 39 | 39 |
| 40 using content::WebContents; | 40 using content::WebContents; |
| 41 using content::WebUIMessageHandler; |
| 41 | 42 |
| 42 namespace { | 43 namespace { |
| 43 | 44 |
| 44 void EnableInternalPDFPluginForTab(TabContentsWrapper* preview_tab) { | 45 void EnableInternalPDFPluginForTab(TabContentsWrapper* preview_tab) { |
| 45 // Always enable the internal PDF plugin for the print preview page. | 46 // Always enable the internal PDF plugin for the print preview page. |
| 46 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( | 47 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( |
| 47 preview_tab->tab_contents()->GetRenderProcessHost()->GetID(), | 48 preview_tab->tab_contents()->GetRenderProcessHost()->GetID(), |
| 48 preview_tab->tab_contents()->GetRenderViewHost()->routing_id(), | 49 preview_tab->tab_contents()->GetRenderViewHost()->routing_id(), |
| 49 GURL(), | 50 GURL(), |
| 50 ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName)); | 51 ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName)); |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 PrintPreviewUI* print_preview_ui = | 484 PrintPreviewUI* print_preview_ui = |
| 484 static_cast<PrintPreviewUI*>(preview_tab->tab_contents()->GetWebUI()); | 485 static_cast<PrintPreviewUI*>(preview_tab->tab_contents()->GetWebUI()); |
| 485 if (print_preview_ui) | 486 if (print_preview_ui) |
| 486 print_preview_ui->OnTabDestroyed(); | 487 print_preview_ui->OnTabDestroyed(); |
| 487 | 488 |
| 488 preview_tab_map_.erase(preview_tab); | 489 preview_tab_map_.erase(preview_tab); |
| 489 RemoveObservers(preview_tab); | 490 RemoveObservers(preview_tab); |
| 490 } | 491 } |
| 491 | 492 |
| 492 } // namespace printing | 493 } // namespace printing |
| OLD | NEW |