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/pairing_registry_delegate_linux.h" | 5 #include "remoting/host/pairing_registry_delegate_linux.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_enumerator.h" | 8 #include "base/files/file_enumerator.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/important_file_writer.h" | 10 #include "base/files/important_file_writer.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 deserializer.Deserialize(&error_code, &error_message); | 53 deserializer.Deserialize(&error_code, &error_message); |
54 if (!pairing_json) { | 54 if (!pairing_json) { |
55 LOG(WARNING) << "Failed to load '" << pairing_file.value() << "' (" | 55 LOG(WARNING) << "Failed to load '" << pairing_file.value() << "' (" |
56 << error_code << ")."; | 56 << error_code << ")."; |
57 continue; | 57 continue; |
58 } | 58 } |
59 | 59 |
60 pairings->Append(pairing_json.release()); | 60 pairings->Append(pairing_json.release()); |
61 } | 61 } |
62 | 62 |
63 return pairings.Pass(); | 63 return pairings; |
64 } | 64 } |
65 | 65 |
66 bool PairingRegistryDelegateLinux::DeleteAll() { | 66 bool PairingRegistryDelegateLinux::DeleteAll() { |
67 // Delete all pairing files in the pairing registry. | 67 // Delete all pairing files in the pairing registry. |
68 base::FilePath registry_path = GetRegistryPath(); | 68 base::FilePath registry_path = GetRegistryPath(); |
69 base::FileEnumerator enumerator(registry_path, false, | 69 base::FileEnumerator enumerator(registry_path, false, |
70 base::FileEnumerator::FILES, | 70 base::FileEnumerator::FILES, |
71 kPairingFilenamePattern); | 71 kPairingFilenamePattern); |
72 | 72 |
73 bool success = true; | 73 bool success = true; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 const base::FilePath& registry_path) { | 154 const base::FilePath& registry_path) { |
155 registry_path_for_testing_ = registry_path; | 155 registry_path_for_testing_ = registry_path; |
156 } | 156 } |
157 | 157 |
158 | 158 |
159 scoped_ptr<PairingRegistry::Delegate> CreatePairingRegistryDelegate() { | 159 scoped_ptr<PairingRegistry::Delegate> CreatePairingRegistryDelegate() { |
160 return make_scoped_ptr(new PairingRegistryDelegateLinux()); | 160 return make_scoped_ptr(new PairingRegistryDelegateLinux()); |
161 } | 161 } |
162 | 162 |
163 } // namespace remoting | 163 } // namespace remoting |
OLD | NEW |