Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: chrome/browser/printing/print_view_manager.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/previews/previews_service_factory.cc ('k') | chrome/browser/resources_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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>>::
35 g_scripted_print_preview_closure_map = LAZY_INSTANCE_INITIALIZER; 35 DestructorAtExit g_scripted_print_preview_closure_map =
36 LAZY_INSTANCE_INITIALIZER;
36 37
37 void EnableInternalPDFPluginForContents(int render_process_id, 38 void EnableInternalPDFPluginForContents(int render_process_id,
38 int render_frame_id) { 39 int render_frame_id) {
39 // Always enable the internal PDF plugin for the print preview page. 40 // Always enable the internal PDF plugin for the print preview page.
40 base::FilePath pdf_plugin_path = base::FilePath::FromUTF8Unsafe( 41 base::FilePath pdf_plugin_path = base::FilePath::FromUTF8Unsafe(
41 ChromeContentClient::kPDFPluginPath); 42 ChromeContentClient::kPDFPluginPath);
42 43
43 content::WebPluginInfo pdf_plugin; 44 content::WebPluginInfo pdf_plugin;
44 if (!content::PluginService::GetInstance()->GetPluginInfoByPath( 45 if (!content::PluginService::GetInstance()->GetPluginInfoByPath(
45 pdf_plugin_path, &pdf_plugin)) { 46 pdf_plugin_path, &pdf_plugin)) {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview, 249 IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview,
249 OnShowScriptedPrintPreview) 250 OnShowScriptedPrintPreview)
250 IPC_MESSAGE_UNHANDLED(handled = false) 251 IPC_MESSAGE_UNHANDLED(handled = false)
251 IPC_END_MESSAGE_MAP() 252 IPC_END_MESSAGE_MAP()
252 253
253 return handled || 254 return handled ||
254 PrintViewManagerBase::OnMessageReceived(message, render_frame_host); 255 PrintViewManagerBase::OnMessageReceived(message, render_frame_host);
255 } 256 }
256 257
257 } // namespace printing 258 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/previews/previews_service_factory.cc ('k') | chrome/browser/resources_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698