| 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 "chrome/browser/chromeos/file_manager/path_util.h" | 5 #include "chrome/browser/chromeos/file_manager/path_util.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
| 10 #include "chrome/browser/chromeos/drive/file_system_util.h" | 10 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 return false; | 56 return false; |
| 57 } | 57 } |
| 58 | 58 |
| 59 std::string GetDownloadsMountPointName(Profile* profile) { | 59 std::string GetDownloadsMountPointName(Profile* profile) { |
| 60 // To distinguish profiles in multi-profile session, we append user name hash | 60 // To distinguish profiles in multi-profile session, we append user name hash |
| 61 // to "Downloads". Note that some profiles (like login or test profiles) | 61 // to "Downloads". Note that some profiles (like login or test profiles) |
| 62 // are not associated with an user account. In that case, no suffix is added | 62 // are not associated with an user account. In that case, no suffix is added |
| 63 // because such a profile never belongs to a multi-profile session. | 63 // because such a profile never belongs to a multi-profile session. |
| 64 user_manager::User* const user = | 64 const user_manager::User* const user = |
| 65 user_manager::UserManager::IsInitialized() | 65 user_manager::UserManager::IsInitialized() |
| 66 ? chromeos::ProfileHelper::Get()->GetUserByProfile( | 66 ? chromeos::ProfileHelper::Get()->GetUserByProfile( |
| 67 profile->GetOriginalProfile()) | 67 profile->GetOriginalProfile()) |
| 68 : NULL; | 68 : NULL; |
| 69 const std::string id = user ? "-" + user->username_hash() : ""; | 69 const std::string id = user ? "-" + user->username_hash() : ""; |
| 70 return net::EscapeQueryParamValue(kDownloadsFolderName + id, false); | 70 return net::EscapeQueryParamValue(kDownloadsFolderName + id, false); |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace util | 73 } // namespace util |
| 74 } // namespace file_manager | 74 } // namespace file_manager |
| OLD | NEW |