OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/filesystem/file_system_impl.h" | 5 #include "components/filesystem/file_system_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 path = base_profile_dir.Append(sanitized_origin); | 83 path = base_profile_dir.Append(sanitized_origin); |
84 #endif | 84 #endif |
85 if (!base::PathExists(path)) | 85 if (!base::PathExists(path)) |
86 base::CreateDirectory(path); | 86 base::CreateDirectory(path); |
87 } | 87 } |
88 | 88 |
89 if (!path.empty()) { | 89 if (!path.empty()) { |
90 DirectoryImpl* dir_impl = | 90 DirectoryImpl* dir_impl = |
91 new DirectoryImpl(std::move(directory), path, std::move(temp_dir)); | 91 new DirectoryImpl(std::move(directory), path, std::move(temp_dir)); |
92 app_->RegisterDirectoryToClient(dir_impl, std::move(client)); | 92 app_->RegisterDirectoryToClient(dir_impl, std::move(client)); |
93 callback.Run(FILE_ERROR_OK); | 93 callback.Run(FileError::OK); |
94 } else { | 94 } else { |
95 callback.Run(FILE_ERROR_FAILED); | 95 callback.Run(FileError::FAILED); |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 base::FilePath FileSystemImpl::GetSystemProfileDir() const { | 99 base::FilePath FileSystemImpl::GetSystemProfileDir() const { |
100 base::FilePath path; | 100 base::FilePath path; |
101 | 101 |
102 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 102 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
103 if (command_line->HasSwitch(kUserDataDir)) { | 103 if (command_line->HasSwitch(kUserDataDir)) { |
104 path = command_line->GetSwitchValuePath(kUserDataDir); | 104 path = command_line->GetSwitchValuePath(kUserDataDir); |
105 } else { | 105 } else { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 encoded[1] += (encoded[1] >= 10) ? 'A' - 10 : '0'; | 153 encoded[1] += (encoded[1] >= 10) ? 'A' - 10 : '0'; |
154 encoded[2] = ch % 16; | 154 encoded[2] = ch % 16; |
155 encoded[2] += (encoded[2] >= 10) ? 'A' - 10 : '0'; | 155 encoded[2] += (encoded[2] >= 10) ? 'A' - 10 : '0'; |
156 encoded_len = 3; | 156 encoded_len = 3; |
157 } | 157 } |
158 sanitized_origin->append(encoded, encoded_len); | 158 sanitized_origin->append(encoded, encoded_len); |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 } // namespace filesystem | 162 } // namespace filesystem |
OLD | NEW |