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_view_manager.h" | 5 #include "chrome/browser/printing/print_view_manager.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "printing/features/features.h" | 24 #include "printing/features/features.h" |
25 | 25 |
26 using content::BrowserThread; | 26 using content::BrowserThread; |
27 | 27 |
28 DEFINE_WEB_CONTENTS_USER_DATA_KEY(printing::PrintViewManager); | 28 DEFINE_WEB_CONTENTS_USER_DATA_KEY(printing::PrintViewManager); |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 // Keeps track of pending scripted print preview closures. | 32 // Keeps track of pending scripted print preview closures. |
33 // No locking, only access on the UI thread. | 33 // No locking, only access on the UI thread. |
34 base::LazyInstance<std::map<content::RenderProcessHost*, base::Closure>>:: | 34 base::LazyInstance<std::map<content::RenderProcessHost*, base::Closure>>::Leaky |
35 DestructorAtExit g_scripted_print_preview_closure_map = | 35 g_scripted_print_preview_closure_map = LAZY_INSTANCE_INITIALIZER; |
36 LAZY_INSTANCE_INITIALIZER; | |
37 | 36 |
38 void EnableInternalPDFPluginForContents(int render_process_id, | 37 void EnableInternalPDFPluginForContents(int render_process_id, |
39 int render_frame_id) { | 38 int render_frame_id) { |
40 // Always enable the internal PDF plugin for the print preview page. | 39 // Always enable the internal PDF plugin for the print preview page. |
41 base::FilePath pdf_plugin_path = base::FilePath::FromUTF8Unsafe( | 40 base::FilePath pdf_plugin_path = base::FilePath::FromUTF8Unsafe( |
42 ChromeContentClient::kPDFPluginPath); | 41 ChromeContentClient::kPDFPluginPath); |
43 | 42 |
44 content::WebPluginInfo pdf_plugin; | 43 content::WebPluginInfo pdf_plugin; |
45 if (!content::PluginService::GetInstance()->GetPluginInfoByPath( | 44 if (!content::PluginService::GetInstance()->GetPluginInfoByPath( |
46 pdf_plugin_path, &pdf_plugin)) { | 45 pdf_plugin_path, &pdf_plugin)) { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview, | 243 IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview, |
245 OnShowScriptedPrintPreview) | 244 OnShowScriptedPrintPreview) |
246 IPC_MESSAGE_UNHANDLED(handled = false) | 245 IPC_MESSAGE_UNHANDLED(handled = false) |
247 IPC_END_MESSAGE_MAP() | 246 IPC_END_MESSAGE_MAP() |
248 | 247 |
249 return handled || | 248 return handled || |
250 PrintViewManagerBase::OnMessageReceived(message, render_frame_host); | 249 PrintViewManagerBase::OnMessageReceived(message, render_frame_host); |
251 } | 250 } |
252 | 251 |
253 } // namespace printing | 252 } // namespace printing |
OLD | NEW |