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 "remoting/host/setup/daemon_controller.h" | 5 #include "remoting/host/setup/daemon_controller.h" |
6 | 6 |
7 #include <unistd.h> | 7 #include <unistd.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 args, base::TimeDelta::FromSeconds(kSudoTimeoutSeconds), | 248 args, base::TimeDelta::FromSeconds(kSudoTimeoutSeconds), |
249 &exit_code) || | 249 &exit_code) || |
250 exit_code != 0) { | 250 exit_code != 0) { |
251 LOG(ERROR) << "Failed to add user to chrome-remote-desktop group."; | 251 LOG(ERROR) << "Failed to add user to chrome-remote-desktop group."; |
252 done_callback.Run(RESULT_FAILED); | 252 done_callback.Run(RESULT_FAILED); |
253 return; | 253 return; |
254 } | 254 } |
255 | 255 |
256 // Ensure the configuration directory exists. | 256 // Ensure the configuration directory exists. |
257 base::FilePath config_dir = GetConfigPath().DirName(); | 257 base::FilePath config_dir = GetConfigPath().DirName(); |
258 if (!file_util::DirectoryExists(config_dir) && | 258 if (!base::DirectoryExists(config_dir) && |
259 !file_util::CreateDirectory(config_dir)) { | 259 !file_util::CreateDirectory(config_dir)) { |
260 LOG(ERROR) << "Failed to create config directory " << config_dir.value(); | 260 LOG(ERROR) << "Failed to create config directory " << config_dir.value(); |
261 done_callback.Run(RESULT_FAILED); | 261 done_callback.Run(RESULT_FAILED); |
262 return; | 262 return; |
263 } | 263 } |
264 | 264 |
265 // Write config. | 265 // Write config. |
266 JsonHostConfig config_file(GetConfigPath()); | 266 JsonHostConfig config_file(GetConfigPath()); |
267 if (!config_file.CopyFrom(config.get()) || | 267 if (!config_file.CopyFrom(config.get()) || |
268 !config_file.Save()) { | 268 !config_file.Save()) { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 done_callback.Run(version); | 352 done_callback.Run(version); |
353 } | 353 } |
354 | 354 |
355 } // namespace | 355 } // namespace |
356 | 356 |
357 scoped_ptr<DaemonController> remoting::DaemonController::Create() { | 357 scoped_ptr<DaemonController> remoting::DaemonController::Create() { |
358 return scoped_ptr<DaemonController>(new DaemonControllerLinux()); | 358 return scoped_ptr<DaemonController>(new DaemonControllerLinux()); |
359 } | 359 } |
360 | 360 |
361 } // namespace remoting | 361 } // namespace remoting |
OLD | NEW |