Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: chrome/browser/chromeos/drive/file_system_util.cc

Issue 444903002: [cros] user_manager component - move UserManagerBase and UserManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: similarity Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 114 }
115 115
116 base::FilePath GetDriveMountPointPath(Profile* profile) { 116 base::FilePath GetDriveMountPointPath(Profile* profile) {
117 std::string id = chromeos::ProfileHelper::GetUserIdHashFromProfile(profile); 117 std::string id = chromeos::ProfileHelper::GetUserIdHashFromProfile(profile);
118 if (id.empty() || id == chrome::kLegacyProfileDir) { 118 if (id.empty() || id == chrome::kLegacyProfileDir) {
119 // ProfileHelper::GetUserIdHashFromProfile works only when multi-profile is 119 // ProfileHelper::GetUserIdHashFromProfile works only when multi-profile is
120 // enabled. In that case, we fall back to use UserManager (it basically just 120 // enabled. In that case, we fall back to use UserManager (it basically just
121 // returns currently active users's hash in such a case.) I still try 121 // returns currently active users's hash in such a case.) I still try
122 // ProfileHelper first because it works better in tests. 122 // ProfileHelper first because it works better in tests.
123 user_manager::User* const user = 123 user_manager::User* const user =
124 chromeos::UserManager::IsInitialized() 124 user_manager::UserManager::IsInitialized()
125 ? chromeos::ProfileHelper::Get()->GetUserByProfile( 125 ? chromeos::ProfileHelper::Get()->GetUserByProfile(
126 profile->GetOriginalProfile()) 126 profile->GetOriginalProfile())
127 : NULL; 127 : NULL;
128 if (user) 128 if (user)
129 id = user->username_hash(); 129 id = user->username_hash();
130 } 130 }
131 return GetDriveMountPointPathForUserIdHash(id); 131 return GetDriveMountPointPathForUserIdHash(id);
132 } 132 }
133 133
134 FileSystemInterface* GetFileSystemByProfile(Profile* profile) { 134 FileSystemInterface* GetFileSystemByProfile(Profile* profile) {
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 const bool disable_sync_over_celluar = 382 const bool disable_sync_over_celluar =
383 profile->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular); 383 profile->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular);
384 384
385 if (is_connection_cellular && disable_sync_over_celluar) 385 if (is_connection_cellular && disable_sync_over_celluar)
386 return DRIVE_CONNECTED_METERED; 386 return DRIVE_CONNECTED_METERED;
387 return DRIVE_CONNECTED; 387 return DRIVE_CONNECTED;
388 } 388 }
389 389
390 } // namespace util 390 } // namespace util
391 } // namespace drive 391 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698