| 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 "chrome/browser/chromeos/drive/file_system_util.h" | 5 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 ? chromeos::ProfileHelper::Get()->GetUserByProfile( | 73 ? chromeos::ProfileHelper::Get()->GetUserByProfile( |
| 74 profile->GetOriginalProfile()) | 74 profile->GetOriginalProfile()) |
| 75 : NULL; | 75 : NULL; |
| 76 if (user) | 76 if (user) |
| 77 id = user->username_hash(); | 77 id = user->username_hash(); |
| 78 } | 78 } |
| 79 return GetDriveMountPointPathForUserIdHash(id); | 79 return GetDriveMountPointPathForUserIdHash(id); |
| 80 } | 80 } |
| 81 | 81 |
| 82 base::FilePath GetDriveMountPointPathForUserIdHash( | 82 base::FilePath GetDriveMountPointPathForUserIdHash( |
| 83 const std::string user_id_hash) { | 83 const std::string& user_id_hash) { |
| 84 static const base::FilePath::CharType kSpecialMountPointRoot[] = | 84 static const base::FilePath::CharType kSpecialMountPointRoot[] = |
| 85 FILE_PATH_LITERAL("/special"); | 85 FILE_PATH_LITERAL("/special"); |
| 86 static const char kDriveMountPointNameBase[] = "drive"; | 86 static const char kDriveMountPointNameBase[] = "drive"; |
| 87 return base::FilePath(kSpecialMountPointRoot) | 87 return base::FilePath(kSpecialMountPointRoot) |
| 88 .AppendASCII(net::EscapeQueryParamValue( | 88 .AppendASCII(net::EscapeQueryParamValue( |
| 89 kDriveMountPointNameBase + | 89 kDriveMountPointNameBase + |
| 90 (user_id_hash.empty() ? "" : "-" + user_id_hash), | 90 (user_id_hash.empty() ? "" : "-" + user_id_hash), |
| 91 false)); | 91 false)); |
| 92 } | 92 } |
| 93 | 93 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 const bool disable_sync_over_celluar = | 249 const bool disable_sync_over_celluar = |
| 250 profile->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular); | 250 profile->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular); |
| 251 | 251 |
| 252 if (is_connection_cellular && disable_sync_over_celluar) | 252 if (is_connection_cellular && disable_sync_over_celluar) |
| 253 return DRIVE_CONNECTED_METERED; | 253 return DRIVE_CONNECTED_METERED; |
| 254 return DRIVE_CONNECTED; | 254 return DRIVE_CONNECTED; |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace util | 257 } // namespace util |
| 258 } // namespace drive | 258 } // namespace drive |
| OLD | NEW |