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

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 328383003: Revert of Introduce SessionManager that will contain code to start user session on Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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) 2013 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/chrome_browser_main_chromeos.h" 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" 43 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h"
44 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" 44 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
45 #include "chrome/browser/chromeos/language_preferences.h" 45 #include "chrome/browser/chromeos/language_preferences.h"
46 #include "chrome/browser/chromeos/login/auth/authenticator.h" 46 #include "chrome/browser/chromeos/login/auth/authenticator.h"
47 #include "chrome/browser/chromeos/login/auth/key.h" 47 #include "chrome/browser/chromeos/login/auth/key.h"
48 #include "chrome/browser/chromeos/login/auth/user_context.h" 48 #include "chrome/browser/chromeos/login/auth/user_context.h"
49 #include "chrome/browser/chromeos/login/helper.h" 49 #include "chrome/browser/chromeos/login/helper.h"
50 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 50 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
51 #include "chrome/browser/chromeos/login/login_utils.h" 51 #include "chrome/browser/chromeos/login/login_utils.h"
52 #include "chrome/browser/chromeos/login/login_wizard.h" 52 #include "chrome/browser/chromeos/login/login_wizard.h"
53 #include "chrome/browser/chromeos/login/session/session_manager.h"
54 #include "chrome/browser/chromeos/login/startup_utils.h" 53 #include "chrome/browser/chromeos/login/startup_utils.h"
55 #include "chrome/browser/chromeos/login/users/user.h" 54 #include "chrome/browser/chromeos/login/users/user.h"
56 #include "chrome/browser/chromeos/login/users/user_manager.h" 55 #include "chrome/browser/chromeos/login/users/user_manager.h"
57 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 56 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
58 #include "chrome/browser/chromeos/login/wizard_controller.h" 57 #include "chrome/browser/chromeos/login/wizard_controller.h"
59 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" 58 #include "chrome/browser/chromeos/memory/oom_priority_manager.h"
60 #include "chrome/browser/chromeos/net/network_portal_detector.h" 59 #include "chrome/browser/chromeos/net/network_portal_detector.h"
61 #include "chrome/browser/chromeos/options/cert_library.h" 60 #include "chrome/browser/chromeos/options/cert_library.h"
62 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 61 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
63 #include "chrome/browser/chromeos/policy/device_local_account.h" 62 #include "chrome/browser/chromeos/policy/device_local_account.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 154
156 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE { 155 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE {
157 LOG(ERROR) << "Login Failure: " << error.GetErrorString(); 156 LOG(ERROR) << "Login Failure: " << error.GetErrorString();
158 delete this; 157 delete this;
159 } 158 }
160 159
161 virtual void OnLoginSuccess(const UserContext& user_context) OVERRIDE { 160 virtual void OnLoginSuccess(const UserContext& user_context) OVERRIDE {
162 if (!profile_prepared_) { 161 if (!profile_prepared_) {
163 // Will call OnProfilePrepared in the end. 162 // Will call OnProfilePrepared in the end.
164 LoginUtils::Get()->PrepareProfile(user_context, 163 LoginUtils::Get()->PrepareProfile(user_context,
164 std::string(), // display_email
165 false, // has_cookies 165 false, // has_cookies
166 true, // has_active_session 166 true, // has_active_session
167 this); 167 this);
168 } else { 168 } else {
169 delete this; 169 delete this;
170 } 170 }
171 } 171 }
172 172
173 // LoginUtils::Delegate implementation: 173 // LoginUtils::Delegate implementation:
174 virtual void OnProfilePrepared(Profile* profile) OVERRIDE { 174 virtual void OnProfilePrepared(Profile* profile) OVERRIDE {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser), 229 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser),
230 parsed_command_line.GetSwitchValueASCII(switches::kLoginPassword)); 230 parsed_command_line.GetSwitchValueASCII(switches::kLoginPassword));
231 } else { 231 } else {
232 if (!parsed_command_line.HasSwitch(::switches::kTestName)) { 232 if (!parsed_command_line.HasSwitch(::switches::kTestName)) {
233 // Enable CrasAudioHandler logging when chrome restarts after crashing. 233 // Enable CrasAudioHandler logging when chrome restarts after crashing.
234 if (chromeos::CrasAudioHandler::IsInitialized()) 234 if (chromeos::CrasAudioHandler::IsInitialized())
235 chromeos::CrasAudioHandler::Get()->LogErrors(); 235 chromeos::CrasAudioHandler::Get()->LogErrors();
236 236
237 // We did not log in (we crashed or are debugging), so we need to 237 // We did not log in (we crashed or are debugging), so we need to
238 // restore Sync. 238 // restore Sync.
239 SessionManager::GetInstance()->RestoreAuthenticationSession(profile); 239 LoginUtils::Get()->RestoreAuthenticationSession(profile);
240 } 240 }
241 } 241 }
242 } 242 }
243 243
244 } // namespace 244 } // namespace
245 245
246 namespace internal { 246 namespace internal {
247 247
248 // Wrapper class for initializing dbus related services and shutting them 248 // Wrapper class for initializing dbus related services and shutting them
249 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the 249 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 std::string login_user = login::CanonicalizeUserID( 625 std::string login_user = login::CanonicalizeUserID(
626 parsed_command_line().GetSwitchValueASCII( 626 parsed_command_line().GetSwitchValueASCII(
627 chromeos::switches::kLoginUser)); 627 chromeos::switches::kLoginUser));
628 if (!base::SysInfo::IsRunningOnChromeOS() && 628 if (!base::SysInfo::IsRunningOnChromeOS() &&
629 login_user == UserManager::kStubUser) { 629 login_user == UserManager::kStubUser) {
630 // For dev machines and stub user emulate as if sync has been initialized. 630 // For dev machines and stub user emulate as if sync has been initialized.
631 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, 631 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
632 login_user); 632 login_user);
633 } 633 }
634 634
635 // This is done in SessionManager::OnProfileCreated during normal login. 635 // This is done in LoginUtils::OnProfileCreated during normal login.
636 SessionManager::GetInstance()->InitRlz(profile()); 636 LoginUtils::Get()->InitRlzDelayed(profile());
637 637
638 // Send the PROFILE_PREPARED notification and call SessionStarted() 638 // Send the PROFILE_PREPARED notification and call SessionStarted()
639 // so that the Launcher and other Profile dependent classes are created. 639 // so that the Launcher and other Profile dependent classes are created.
640 content::NotificationService::current()->Notify( 640 content::NotificationService::current()->Notify(
641 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, 641 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
642 content::NotificationService::AllSources(), 642 content::NotificationService::AllSources(),
643 content::Details<Profile>(profile())); 643 content::Details<Profile>(profile()));
644 UserManager::Get()->SessionStarted(); 644 UserManager::Get()->SessionStarted();
645 645
646 // Now is the good time to retrieve other logged in users for this session. 646 // Now is the good time to retrieve other logged in users for this session.
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 // Destroy DBus services immediately after threads are stopped. 865 // Destroy DBus services immediately after threads are stopped.
866 dbus_services_.reset(); 866 dbus_services_.reset();
867 867
868 ChromeBrowserMainPartsLinux::PostDestroyThreads(); 868 ChromeBrowserMainPartsLinux::PostDestroyThreads();
869 869
870 // Destroy DeviceSettingsService after g_browser_process. 870 // Destroy DeviceSettingsService after g_browser_process.
871 DeviceSettingsService::Shutdown(); 871 DeviceSettingsService::Shutdown();
872 } 872 }
873 873
874 } // namespace chromeos 874 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc ('k') | chrome/browser/chromeos/login/existing_user_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698