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

Side by Side Diff: chrome/test/base/testing_profile_manager.cc

Issue 2945023002: Introduce profile for lock screen apps (Closed)
Patch Set: rebase Created 3 years, 5 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
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/test/base/testing_profile_manager.h" 5 #include "chrome/test/base/testing_profile_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 std::unique_ptr<sync_preferences::PrefServiceSyncable> prefs, 63 std::unique_ptr<sync_preferences::PrefServiceSyncable> prefs,
64 const base::string16& user_name, 64 const base::string16& user_name,
65 int avatar_id, 65 int avatar_id,
66 const std::string& supervised_user_id, 66 const std::string& supervised_user_id,
67 const TestingProfile::TestingFactories& factories) { 67 const TestingProfile::TestingFactories& factories) {
68 DCHECK(called_set_up_); 68 DCHECK(called_set_up_);
69 69
70 // Create a path for the profile based on the name. 70 // Create a path for the profile based on the name.
71 base::FilePath profile_path(profiles_dir_.GetPath()); 71 base::FilePath profile_path(profiles_dir_.GetPath());
72 #if defined(OS_CHROMEOS) 72 #if defined(OS_CHROMEOS)
73 if (profile_name != chrome::kInitialProfile) { 73 if (profile_name != chrome::kInitialProfile &&
74 profile_name != chromeos::ProfileHelper::GetLockScreenAppProfileName()) {
74 profile_path = 75 profile_path =
75 profile_path.Append(chromeos::ProfileHelper::Get()->GetUserProfileDir( 76 profile_path.Append(chromeos::ProfileHelper::Get()->GetUserProfileDir(
76 chromeos::ProfileHelper::GetUserIdHashByUserIdForTesting( 77 chromeos::ProfileHelper::GetUserIdHashByUserIdForTesting(
77 profile_name))); 78 profile_name)));
78 } else { 79 } else {
79 profile_path = profile_path.AppendASCII(profile_name); 80 profile_path = profile_path.AppendASCII(profile_name);
80 } 81 }
81 #else 82 #else
82 profile_path = profile_path.AppendASCII(profile_name); 83 profile_path = profile_path.AppendASCII(profile_name);
83 #endif 84 #endif
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 // Set up the directory for profiles. 248 // Set up the directory for profiles.
248 ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir()); 249 ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir());
249 250
250 profile_manager_ = new testing::ProfileManager(profiles_dir_.GetPath()); 251 profile_manager_ = new testing::ProfileManager(profiles_dir_.GetPath());
251 browser_process_->SetProfileManager(profile_manager_); // Takes ownership. 252 browser_process_->SetProfileManager(profile_manager_); // Takes ownership.
252 253
253 profile_manager_->GetProfileInfoCache(). 254 profile_manager_->GetProfileInfoCache().
254 set_disable_avatar_download_for_testing(true); 255 set_disable_avatar_download_for_testing(true);
255 called_set_up_ = true; 256 called_set_up_ = true;
256 } 257 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.cc ('k') | extensions/browser/process_map_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698