OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_delegate_linux.h" | 5 #include "remoting/host/setup/daemon_controller_delegate_linux.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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 &exit_code) || | 180 &exit_code) || |
181 exit_code != 0) { | 181 exit_code != 0) { |
182 LOG(ERROR) << "Failed to add user to chrome-remote-desktop group."; | 182 LOG(ERROR) << "Failed to add user to chrome-remote-desktop group."; |
183 done.Run(DaemonController::RESULT_FAILED); | 183 done.Run(DaemonController::RESULT_FAILED); |
184 return; | 184 return; |
185 } | 185 } |
186 | 186 |
187 // Ensure the configuration directory exists. | 187 // Ensure the configuration directory exists. |
188 base::FilePath config_dir = GetConfigPath().DirName(); | 188 base::FilePath config_dir = GetConfigPath().DirName(); |
189 if (!base::DirectoryExists(config_dir) && | 189 if (!base::DirectoryExists(config_dir) && |
190 !file_util::CreateDirectory(config_dir)) { | 190 !base::CreateDirectory(config_dir)) { |
191 LOG(ERROR) << "Failed to create config directory " << config_dir.value(); | 191 LOG(ERROR) << "Failed to create config directory " << config_dir.value(); |
192 done.Run(DaemonController::RESULT_FAILED); | 192 done.Run(DaemonController::RESULT_FAILED); |
193 return; | 193 return; |
194 } | 194 } |
195 | 195 |
196 // Write config. | 196 // Write config. |
197 JsonHostConfig config_file(GetConfigPath()); | 197 JsonHostConfig config_file(GetConfigPath()); |
198 if (!config_file.CopyFrom(config.get()) || | 198 if (!config_file.CopyFrom(config.get()) || |
199 !config_file.Save()) { | 199 !config_file.Save()) { |
200 LOG(ERROR) << "Failed to update config file."; | 200 LOG(ERROR) << "Failed to update config file."; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 return consent; | 288 return consent; |
289 } | 289 } |
290 | 290 |
291 scoped_refptr<DaemonController> DaemonController::Create() { | 291 scoped_refptr<DaemonController> DaemonController::Create() { |
292 scoped_ptr<DaemonController::Delegate> delegate( | 292 scoped_ptr<DaemonController::Delegate> delegate( |
293 new DaemonControllerDelegateLinux()); | 293 new DaemonControllerDelegateLinux()); |
294 return new DaemonController(delegate.Pass()); | 294 return new DaemonController(delegate.Pass()); |
295 } | 295 } |
296 | 296 |
297 } // namespace remoting | 297 } // namespace remoting |
OLD | NEW |