OLD | NEW |
| (Empty) |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/chromeos/profiles/profile_helper.h" | |
6 | |
7 #include "chrome/browser/browser_process.h" | |
8 #include "chrome/browser/chromeos/cros/cros_library.h" | |
9 #include "chrome/browser/chromeos/cros/network_library.h" | |
10 #include "chrome/browser/chromeos/sms_observer.h" | |
11 #include "chrome/browser/profiles/profile.h" | |
12 #include "chrome/browser/profiles/profile_destroyer.h" | |
13 #include "chrome/browser/profiles/profile_manager.h" | |
14 #include "chrome/common/chrome_constants.h" | |
15 | |
16 | |
17 namespace chromeos { | |
18 | |
19 // static | |
20 Profile* ProfileHelper::GetSigninProfile() { | |
21 ProfileManager* profile_manager = g_browser_process->profile_manager(); | |
22 base::FilePath user_data_dir = profile_manager->user_data_dir(); | |
23 base::FilePath signin_profile_dir = | |
24 user_data_dir.AppendASCII(chrome::kInitialProfile); | |
25 return profile_manager->GetProfile(signin_profile_dir)-> | |
26 GetOffTheRecordProfile(); | |
27 } | |
28 | |
29 // static | |
30 void ProfileHelper::ProfileStartup(Profile* profile, bool process_startup) { | |
31 // Initialize Chrome OS preferences like touch pad sensitivity. For the | |
32 // preferences to work in the guest mode, the initialization has to be | |
33 // done after |profile| is switched to the incognito profile (which | |
34 // is actually GuestSessionProfile in the guest mode). See the | |
35 // GetOffTheRecordProfile() call above. | |
36 profile->InitChromeOSPreferences(); | |
37 | |
38 if (process_startup) { | |
39 static chromeos::SmsObserver* sms_observer = | |
40 new chromeos::SmsObserver(); | |
41 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> | |
42 AddNetworkManagerObserver(sms_observer); | |
43 | |
44 profile->SetupChromeOSEnterpriseExtensionObserver(); | |
45 } | |
46 } | |
47 | |
48 } // namespace chromeos | |
OLD | NEW |