Chromium Code Reviews| Index: chrome/browser/chromeos/profiles/profile_helper.cc |
| diff --git a/chrome/browser/chromeos/profile_startup.cc b/chrome/browser/chromeos/profiles/profile_helper.cc |
| similarity index 57% |
| rename from chrome/browser/chromeos/profile_startup.cc |
| rename to chrome/browser/chromeos/profiles/profile_helper.cc |
| index 56216de5a8633c6507f74e4402dce6557415342f..3d4bb0b034f2cacb1484a1bc25000e4f1d42a57c 100644 |
| --- a/chrome/browser/chromeos/profile_startup.cc |
| +++ b/chrome/browser/chromeos/profiles/profile_helper.cc |
| @@ -1,23 +1,36 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/browser/chromeos/profile_startup.h" |
| +#include "chrome/browser/chromeos/profiles/profile_helper.h" |
| +#include "chrome/browser/browser_process.h" |
| #include "chrome/browser/chromeos/cros/cros_library.h" |
| #include "chrome/browser/chromeos/cros/network_library.h" |
| -#include "chrome/browser/chromeos/customization_document.h" |
| -#include "chrome/browser/chromeos/enterprise_extension_observer.h" |
| #include "chrome/browser/chromeos/sms_observer.h" |
| #include "chrome/browser/profiles/profile.h" |
| -#include "chromeos/dbus/dbus_thread_manager.h" |
| +#include "chrome/browser/profiles/profile_destroyer.h" |
| +#include "chrome/browser/profiles/profile_manager.h" |
| +#include "chrome/common/chrome_constants.h" |
| + |
| namespace chromeos { |
| +// static |
| +Profile* ProfileHelper::GetSigninProfile() { |
| + ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| + base::FilePath user_data_dir = profile_manager->user_data_dir(); |
| + base::FilePath signin_profile_dir = |
| + user_data_dir.AppendASCII(chrome::kInitialProfile); |
| + return profile_manager->GetProfile(signin_profile_dir)-> |
| + GetOffTheRecordProfile(); |
| +} |
| + |
| +// static |
| // TODO(beng): It is very fishy that any of these services need to be tied to |
| // a browser profile. This dependency should be severed and this |
| // init moved earlier in startup. |
| -void ProfileStartup(Profile* profile, bool process_startup) { |
| +void ProfileHelper::ProfileStartup(Profile* profile, bool process_startup) { |
| // Initialize Chrome OS preferences like touch pad sensitivity. For the |
| // preferences to work in the guest mode, the initialization has to be |
| // done after |profile| is switched to the incognito profile (which |
| @@ -27,7 +40,7 @@ void ProfileStartup(Profile* profile, bool process_startup) { |
| if (process_startup) { |
| static chromeos::SmsObserver* sms_observer = |
| - new chromeos::SmsObserver(profile); |
| + new chromeos::SmsObserver(); |
| chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> |
| AddNetworkManagerObserver(sms_observer); |
| @@ -35,4 +48,5 @@ void ProfileStartup(Profile* profile, bool process_startup) { |
| } |
| } |
| -} // namespace chromeos |
| +} // namespace chromeos |
|
Nikita (slow)
2013/04/12 16:03:17
nit: It should be 2 spaces before namespace commen
dzhioev (left Google)
2013/04/15 07:20:03
Done.
|
| + |