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

Side by Side Diff: chrome/service/cloud_print/cloud_print_proxy.cc

Issue 1010923002: If possible, use the PathService instead of the --user-data-dir flag directly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo some changes Created 5 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/installer/util/auto_launch_util.cc ('k') | no next file » | 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/service/cloud_print/cloud_print_proxy.h" 5 #include "chrome/service/cloud_print/cloud_print_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 16 matching lines...) Expand all
27 void LaunchBrowserProcessWithSwitch(const std::string& switch_string) { 27 void LaunchBrowserProcessWithSwitch(const std::string& switch_string) {
28 DCHECK(g_service_process->io_thread()->message_loop_proxy()-> 28 DCHECK(g_service_process->io_thread()->message_loop_proxy()->
29 BelongsToCurrentThread()); 29 BelongsToCurrentThread());
30 base::FilePath exe_path; 30 base::FilePath exe_path;
31 PathService::Get(base::FILE_EXE, &exe_path); 31 PathService::Get(base::FILE_EXE, &exe_path);
32 if (exe_path.empty()) { 32 if (exe_path.empty()) {
33 NOTREACHED() << "Unable to get browser process binary name."; 33 NOTREACHED() << "Unable to get browser process binary name.";
34 } 34 }
35 base::CommandLine cmd_line(exe_path); 35 base::CommandLine cmd_line(exe_path);
36 36
37 // Propagate an explicit --user-data-dir value if one was given. The new
38 // browser process will pick up a policy override during initialization.
37 const base::CommandLine& process_command_line = 39 const base::CommandLine& process_command_line =
38 *base::CommandLine::ForCurrentProcess(); 40 *base::CommandLine::ForCurrentProcess();
39 base::FilePath user_data_dir = 41 base::FilePath user_data_dir =
40 process_command_line.GetSwitchValuePath(switches::kUserDataDir); 42 process_command_line.GetSwitchValuePath(switches::kUserDataDir);
41 if (!user_data_dir.empty()) 43 if (!user_data_dir.empty())
42 cmd_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir); 44 cmd_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir);
43 cmd_line.AppendSwitch(switch_string); 45 cmd_line.AppendSwitch(switch_string);
44 46
45 #if defined(OS_POSIX) && !defined(OS_MACOSX) 47 #if defined(OS_POSIX) && !defined(OS_MACOSX)
46 base::Process process = base::LaunchProcess(cmd_line, base::LaunchOptions()); 48 base::Process process = base::LaunchProcess(cmd_line, base::LaunchOptions());
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } 289 }
288 290
289 void CloudPrintProxy::ShutdownBackend() { 291 void CloudPrintProxy::ShutdownBackend() {
290 DCHECK(CalledOnValidThread()); 292 DCHECK(CalledOnValidThread());
291 if (backend_.get()) 293 if (backend_.get())
292 backend_->Shutdown(); 294 backend_->Shutdown();
293 backend_.reset(); 295 backend_.reset();
294 } 296 }
295 297
296 } // namespace cloud_print 298 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/installer/util/auto_launch_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698