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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 base::FilePath GetDownloadsFolderForProfile(Profile* profile) { | 34 base::FilePath GetDownloadsFolderForProfile(Profile* profile) { |
35 // On non-ChromeOS system (test+development), the primary profile uses | 35 // On non-ChromeOS system (test+development), the primary profile uses |
36 // $HOME/Downloads for ease for accessing local files for debugging. | 36 // $HOME/Downloads for ease for accessing local files for debugging. |
37 if (!base::SysInfo::IsRunningOnChromeOS() && | 37 if (!base::SysInfo::IsRunningOnChromeOS() && |
38 chromeos::UserManager::IsInitialized()) { | 38 chromeos::UserManager::IsInitialized()) { |
39 const chromeos::User* const user = | 39 const chromeos::User* const user = |
40 chromeos::ProfileHelper::Get()->GetUserByProfile( | 40 chromeos::ProfileHelper::Get()->GetUserByProfile( |
41 profile->GetOriginalProfile()); | 41 profile->GetOriginalProfile()); |
42 const chromeos::User* const primary_user = | 42 const chromeos::User* const primary_user = |
43 chromeos::UserManager::Get()->GetPrimaryUser(); | 43 chromeos::GetUserManager()->GetPrimaryUser(); |
44 if (user == primary_user) | 44 if (user == primary_user) |
45 return DownloadPrefs::GetDefaultDownloadDirectory(); | 45 return DownloadPrefs::GetDefaultDownloadDirectory(); |
46 } | 46 } |
47 return profile->GetPath().AppendASCII(kDownloadsFolderName); | 47 return profile->GetPath().AppendASCII(kDownloadsFolderName); |
48 } | 48 } |
49 | 49 |
50 bool MigratePathFromOldFormat(Profile* profile, | 50 bool MigratePathFromOldFormat(Profile* profile, |
51 const base::FilePath& old_path, | 51 const base::FilePath& old_path, |
52 base::FilePath* new_path) { | 52 base::FilePath* new_path) { |
53 // M34: | 53 // M34: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 chromeos::UserManager::IsInitialized() | 110 chromeos::UserManager::IsInitialized() |
111 ? chromeos::ProfileHelper::Get()->GetUserByProfile( | 111 ? chromeos::ProfileHelper::Get()->GetUserByProfile( |
112 profile->GetOriginalProfile()) | 112 profile->GetOriginalProfile()) |
113 : NULL; | 113 : NULL; |
114 const std::string id = user ? "-" + user->username_hash() : ""; | 114 const std::string id = user ? "-" + user->username_hash() : ""; |
115 return net::EscapeQueryParamValue(kDownloadsFolderName + id, false); | 115 return net::EscapeQueryParamValue(kDownloadsFolderName + id, false); |
116 } | 116 } |
117 | 117 |
118 } // namespace util | 118 } // namespace util |
119 } // namespace file_manager | 119 } // namespace file_manager |
OLD | NEW |