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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 base::MD5Context ctx; | 48 base::MD5Context ctx; |
49 base::MD5Init(&ctx); | 49 base::MD5Init(&ctx); |
50 base::MD5Update(&ctx, value); | 50 base::MD5Update(&ctx, value); |
51 base::MD5Digest digest; | 51 base::MD5Digest digest; |
52 base::MD5Final(&digest, &ctx); | 52 base::MD5Final(&digest, &ctx); |
53 return StringToLowerASCII(base::HexEncode(digest.a, sizeof(digest.a))); | 53 return StringToLowerASCII(base::HexEncode(digest.a, sizeof(digest.a))); |
54 } | 54 } |
55 | 55 |
56 base::FilePath GetConfigPath() { | 56 base::FilePath GetConfigPath() { |
57 std::string filename = "host#" + GetMd5(net::GetHostName()) + ".json"; | 57 std::string filename = "host#" + GetMd5(net::GetHostName()) + ".json"; |
58 return file_util::GetHomeDir(). | 58 return base::GetHomeDir(). |
59 Append(".config/chrome-remote-desktop").Append(filename); | 59 Append(".config/chrome-remote-desktop").Append(filename); |
60 } | 60 } |
61 | 61 |
62 bool GetScriptPath(base::FilePath* result) { | 62 bool GetScriptPath(base::FilePath* result) { |
63 base::FilePath candidate_exe(kDaemonScript); | 63 base::FilePath candidate_exe(kDaemonScript); |
64 if (access(candidate_exe.value().c_str(), X_OK) == 0) { | 64 if (access(candidate_exe.value().c_str(), X_OK) == 0) { |
65 *result = candidate_exe; | 65 *result = candidate_exe; |
66 return true; | 66 return true; |
67 } | 67 } |
68 return false; | 68 return false; |
(...skipping 219 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 |