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

Side by Side Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 22909019: Start the session, then restore browser Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/chromeos/login/login_utils.h" 5 #include "chrome/browser/chromeos/login/login_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/chromeos/chromeos_version.h" 10 #include "base/chromeos/chromeos_version.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } 270 }
271 271
272 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); 272 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false);
273 273
274 VLOG(1) << "Launching browser..."; 274 VLOG(1) << "Launching browser...";
275 StartupBrowserCreator browser_creator; 275 StartupBrowserCreator browser_creator;
276 int return_code; 276 int return_code;
277 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? 277 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
278 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; 278 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN;
279 279
280 // Mark login host for deletion after browser starts. This
281 // guarantees that the message loop will be referenced by the
282 // browser before it is dereferenced by the login host.
283 if (login_host)
284 login_host->Finalize();
285 UserManager::Get()->SessionStarted();
286
280 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), 287 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(),
281 profile, 288 profile,
282 base::FilePath(), 289 base::FilePath(),
283 chrome::startup::IS_PROCESS_STARTUP, 290 chrome::startup::IS_PROCESS_STARTUP,
284 first_run, 291 first_run,
285 &return_code); 292 &return_code);
286
287 // Mark login host for deletion after browser starts. This
288 // guarantees that the message loop will be referenced by the
289 // browser before it is dereferenced by the login host.
290 if (login_host)
291 login_host->Finalize();
292 UserManager::Get()->SessionStarted();
293 } 293 }
294 294
295 void LoginUtilsImpl::PrepareProfile( 295 void LoginUtilsImpl::PrepareProfile(
296 const UserContext& user_context, 296 const UserContext& user_context,
297 const std::string& display_email, 297 const std::string& display_email,
298 bool using_oauth, 298 bool using_oauth,
299 bool has_cookies, 299 bool has_cookies,
300 bool has_active_session, 300 bool has_active_session,
301 LoginUtils::Delegate* delegate) { 301 LoginUtils::Delegate* delegate) {
302 BootTimesLoader* btl = BootTimesLoader::Get(); 302 BootTimesLoader* btl = BootTimesLoader::Get();
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 bool LoginUtils::IsWhitelisted(const std::string& username) { 777 bool LoginUtils::IsWhitelisted(const std::string& username) {
778 CrosSettings* cros_settings = CrosSettings::Get(); 778 CrosSettings* cros_settings = CrosSettings::Get();
779 bool allow_new_user = false; 779 bool allow_new_user = false;
780 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 780 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
781 if (allow_new_user) 781 if (allow_new_user)
782 return true; 782 return true;
783 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); 783 return cros_settings->FindEmailInList(kAccountsPrefUsers, username);
784 } 784 }
785 785
786 } // namespace chromeos 786 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698