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 "rlz/chromeos/lib/rlz_value_store_chromeos.h" | 5 #include "rlz/chromeos/lib/rlz_value_store_chromeos.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/important_file_writer.h" | 8 #include "base/files/important_file_writer.h" |
9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 // RLZ store filename. | 36 // RLZ store filename. |
37 const base::FilePath::CharType kRLZDataFileName[] = | 37 const base::FilePath::CharType kRLZDataFileName[] = |
38 FILE_PATH_LITERAL("RLZ Data"); | 38 FILE_PATH_LITERAL("RLZ Data"); |
39 | 39 |
40 // RLZ store lock filename | 40 // RLZ store lock filename |
41 const base::FilePath::CharType kRLZLockFileName[] = | 41 const base::FilePath::CharType kRLZLockFileName[] = |
42 FILE_PATH_LITERAL("RLZ Data.lock"); | 42 FILE_PATH_LITERAL("RLZ Data.lock"); |
43 | 43 |
44 // RLZ store path for testing. | 44 // RLZ store path for testing. |
45 FilePath g_testing_rlz_store_path_; | 45 base::FilePath g_testing_rlz_store_path_; |
46 | 46 |
47 // Returns file path of the RLZ storage. | 47 // Returns file path of the RLZ storage. |
48 FilePath GetRlzStorePath() { | 48 base::FilePath GetRlzStorePath() { |
49 return g_testing_rlz_store_path_.empty() ? | 49 return g_testing_rlz_store_path_.empty() ? |
50 file_util::GetHomeDir().Append(kRLZDataFileName) : | 50 file_util::GetHomeDir().Append(kRLZDataFileName) : |
51 g_testing_rlz_store_path_.Append(kRLZDataFileName); | 51 g_testing_rlz_store_path_.Append(kRLZDataFileName); |
52 } | 52 } |
53 | 53 |
54 // Returns file path of the RLZ storage lock file. | 54 // Returns file path of the RLZ storage lock file. |
55 FilePath GetRlzStoreLockPath() { | 55 base::FilePath GetRlzStoreLockPath() { |
56 return g_testing_rlz_store_path_.empty() ? | 56 return g_testing_rlz_store_path_.empty() ? |
57 file_util::GetHomeDir().Append(kRLZLockFileName) : | 57 file_util::GetHomeDir().Append(kRLZLockFileName) : |
58 g_testing_rlz_store_path_.Append(kRLZLockFileName); | 58 g_testing_rlz_store_path_.Append(kRLZLockFileName); |
59 } | 59 } |
60 | 60 |
61 // Returns the dictionary key for storing access point-related prefs. | 61 // Returns the dictionary key for storing access point-related prefs. |
62 std::string GetKeyName(std::string key, AccessPoint access_point) { | 62 std::string GetKeyName(std::string key, AccessPoint access_point) { |
63 std::string brand = SupplementaryBranding::GetBrand(); | 63 std::string brand = SupplementaryBranding::GetBrand(); |
64 if (brand.empty()) | 64 if (brand.empty()) |
65 brand = kNoSupplementaryBrand; | 65 brand = kNoSupplementaryBrand; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 g_testing_rlz_store_path_ = directory; | 330 g_testing_rlz_store_path_ = directory; |
331 } | 331 } |
332 | 332 |
333 std::string RlzStoreFilenameStr() { | 333 std::string RlzStoreFilenameStr() { |
334 return GetRlzStorePath().value(); | 334 return GetRlzStorePath().value(); |
335 } | 335 } |
336 | 336 |
337 } // namespace testing | 337 } // namespace testing |
338 | 338 |
339 } // namespace rlz_lib | 339 } // namespace rlz_lib |
OLD | NEW |