OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/profile_startup.h" | 5 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | |
7 #include "chrome/browser/chromeos/cros/cros_library.h" | 8 #include "chrome/browser/chromeos/cros/cros_library.h" |
8 #include "chrome/browser/chromeos/cros/network_library.h" | 9 #include "chrome/browser/chromeos/cros/network_library.h" |
9 #include "chrome/browser/chromeos/customization_document.h" | |
10 #include "chrome/browser/chromeos/enterprise_extension_observer.h" | |
11 #include "chrome/browser/chromeos/sms_observer.h" | 10 #include "chrome/browser/chromeos/sms_observer.h" |
12 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
13 #include "chromeos/dbus/dbus_thread_manager.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 | |
14 | 16 |
15 namespace chromeos { | 17 namespace chromeos { |
16 | 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 | |
17 // TODO(beng): It is very fishy that any of these services need to be tied to | 30 // TODO(beng): It is very fishy that any of these services need to be tied to |
sail
2013/04/15 15:42:53
remove comment
dzhioev (left Google)
2013/04/15 19:48:11
Done.
| |
18 // a browser profile. This dependency should be severed and this | 31 // a browser profile. This dependency should be severed and this |
19 // init moved earlier in startup. | 32 // init moved earlier in startup. |
20 void ProfileStartup(Profile* profile, bool process_startup) { | 33 void ProfileHelper::ProfileStartup(Profile* profile, bool process_startup) { |
21 // Initialize Chrome OS preferences like touch pad sensitivity. For the | 34 // Initialize Chrome OS preferences like touch pad sensitivity. For the |
22 // preferences to work in the guest mode, the initialization has to be | 35 // preferences to work in the guest mode, the initialization has to be |
23 // done after |profile| is switched to the incognito profile (which | 36 // done after |profile| is switched to the incognito profile (which |
24 // is actually GuestSessionProfile in the guest mode). See the | 37 // is actually GuestSessionProfile in the guest mode). See the |
25 // GetOffTheRecordProfile() call above. | 38 // GetOffTheRecordProfile() call above. |
26 profile->InitChromeOSPreferences(); | 39 profile->InitChromeOSPreferences(); |
27 | 40 |
28 if (process_startup) { | 41 if (process_startup) { |
29 static chromeos::SmsObserver* sms_observer = | 42 static chromeos::SmsObserver* sms_observer = |
30 new chromeos::SmsObserver(profile); | 43 new chromeos::SmsObserver(); |
31 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> | 44 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> |
32 AddNetworkManagerObserver(sms_observer); | 45 AddNetworkManagerObserver(sms_observer); |
33 | 46 |
34 profile->SetupChromeOSEnterpriseExtensionObserver(); | 47 profile->SetupChromeOSEnterpriseExtensionObserver(); |
35 } | 48 } |
36 } | 49 } |
37 | 50 |
38 } // namespace chromeos | 51 } // namespace chromeos |
52 | |
sail
2013/04/15 15:42:53
remove extra new line?
dzhioev (left Google)
2013/04/15 19:48:11
Only one new line here.
| |
OLD | NEW |