| 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/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 // Timeout for commands that require password prompt - 5 minutes. | 47 // Timeout for commands that require password prompt - 5 minutes. |
| 48 const int64 kSudoTimeoutSeconds = 5 * 60; | 48 const int64 kSudoTimeoutSeconds = 5 * 60; |
| 49 | 49 |
| 50 std::string GetMd5(const std::string& value) { | 50 std::string GetMd5(const std::string& value) { |
| 51 base::MD5Context ctx; | 51 base::MD5Context ctx; |
| 52 base::MD5Init(&ctx); | 52 base::MD5Init(&ctx); |
| 53 base::MD5Update(&ctx, value); | 53 base::MD5Update(&ctx, value); |
| 54 base::MD5Digest digest; | 54 base::MD5Digest digest; |
| 55 base::MD5Final(&digest, &ctx); | 55 base::MD5Final(&digest, &ctx); |
| 56 return StringToLowerASCII(base::HexEncode(digest.a, sizeof(digest.a))); | 56 return base::StringToLowerASCII(base::HexEncode(digest.a, sizeof(digest.a))); |
| 57 } | 57 } |
| 58 | 58 |
| 59 base::FilePath GetConfigPath() { | 59 base::FilePath GetConfigPath() { |
| 60 std::string filename = "host#" + GetMd5(net::GetHostName()) + ".json"; | 60 std::string filename = "host#" + GetMd5(net::GetHostName()) + ".json"; |
| 61 base::FilePath homedir; | 61 base::FilePath homedir; |
| 62 PathService::Get(base::DIR_HOME, &homedir); | 62 PathService::Get(base::DIR_HOME, &homedir); |
| 63 return homedir.Append(".config/chrome-remote-desktop").Append(filename); | 63 return homedir.Append(".config/chrome-remote-desktop").Append(filename); |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool GetScriptPath(base::FilePath* result) { | 66 bool GetScriptPath(base::FilePath* result) { |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 return consent; | 324 return consent; |
| 325 } | 325 } |
| 326 | 326 |
| 327 scoped_refptr<DaemonController> DaemonController::Create() { | 327 scoped_refptr<DaemonController> DaemonController::Create() { |
| 328 scoped_ptr<DaemonController::Delegate> delegate( | 328 scoped_ptr<DaemonController::Delegate> delegate( |
| 329 new DaemonControllerDelegateLinux()); | 329 new DaemonControllerDelegateLinux()); |
| 330 return new DaemonController(delegate.Pass()); | 330 return new DaemonController(delegate.Pass()); |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace remoting | 333 } // namespace remoting |
| OLD | NEW |