| OLD | NEW |
| 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 <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 #include "components/user_manager/user.h" | 83 #include "components/user_manager/user.h" |
| 84 #include "components/user_manager/user_manager.h" | 84 #include "components/user_manager/user_manager.h" |
| 85 #include "content/public/browser/browser_thread.h" | 85 #include "content/public/browser/browser_thread.h" |
| 86 #include "content/public/browser/notification_service.h" | 86 #include "content/public/browser/notification_service.h" |
| 87 #include "google_apis/gaia/gaia_auth_consumer.h" | 87 #include "google_apis/gaia/gaia_auth_consumer.h" |
| 88 #include "net/base/network_change_notifier.h" | 88 #include "net/base/network_change_notifier.h" |
| 89 #include "net/url_request/url_request_context.h" | 89 #include "net/url_request/url_request_context.h" |
| 90 #include "net/url_request/url_request_context_getter.h" | 90 #include "net/url_request/url_request_context_getter.h" |
| 91 #include "url/gurl.h" | 91 #include "url/gurl.h" |
| 92 | 92 |
| 93 #if defined(USE_ATHENA) |
| 94 #include "athena/extensions/public/extensions_delegate.h" |
| 95 #include "athena/main/public/athena_launcher.h" |
| 96 #endif |
| 97 |
| 93 using content::BrowserThread; | 98 using content::BrowserThread; |
| 94 | 99 |
| 95 namespace { | 100 namespace { |
| 96 | 101 |
| 97 void LogCustomSwitches(const std::set<std::string>& switches) { | 102 void LogCustomSwitches(const std::set<std::string>& switches) { |
| 98 if (!VLOG_IS_ON(1)) | 103 if (!VLOG_IS_ON(1)) |
| 99 return; | 104 return; |
| 100 for (std::set<std::string>::const_iterator it = switches.begin(); | 105 for (std::set<std::string>::const_iterator it = switches.begin(); |
| 101 it != switches.end(); | 106 it != switches.end(); |
| 102 ++it) { | 107 ++it) { |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 282 |
| 278 if (login_host) { | 283 if (login_host) { |
| 279 login_host->SetStatusAreaVisible(true); | 284 login_host->SetStatusAreaVisible(true); |
| 280 login_host->BeforeSessionStart(); | 285 login_host->BeforeSessionStart(); |
| 281 } | 286 } |
| 282 | 287 |
| 283 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); | 288 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); |
| 284 | 289 |
| 285 VLOG(1) << "Launching browser..."; | 290 VLOG(1) << "Launching browser..."; |
| 286 TRACE_EVENT0("login", "LaunchBrowser"); | 291 TRACE_EVENT0("login", "LaunchBrowser"); |
| 292 |
| 293 #if defined(USE_ATHENA) |
| 294 athena::ExtensionsDelegate::CreateExtensionsDelegateForChrome(profile); |
| 295 athena::StartAthenaSessionWithContext(profile); |
| 296 #else |
| 287 StartupBrowserCreator browser_creator; | 297 StartupBrowserCreator browser_creator; |
| 288 int return_code; | 298 int return_code; |
| 289 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? | 299 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? |
| 290 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; | 300 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; |
| 291 | 301 |
| 292 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), | 302 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), |
| 293 profile, | 303 profile, |
| 294 base::FilePath(), | 304 base::FilePath(), |
| 295 chrome::startup::IS_PROCESS_STARTUP, | 305 chrome::startup::IS_PROCESS_STARTUP, |
| 296 first_run, | 306 first_run, |
| 297 &return_code); | 307 &return_code); |
| 298 | 308 |
| 299 // Triggers app launcher start page service to load start page web contents. | 309 // Triggers app launcher start page service to load start page web contents. |
| 300 app_list::StartPageService::Get(profile); | 310 app_list::StartPageService::Get(profile); |
| 311 #endif |
| 301 | 312 |
| 302 // Mark login host for deletion after browser starts. This | 313 // Mark login host for deletion after browser starts. This |
| 303 // guarantees that the message loop will be referenced by the | 314 // guarantees that the message loop will be referenced by the |
| 304 // browser before it is dereferenced by the login host. | 315 // browser before it is dereferenced by the login host. |
| 305 if (login_host) | 316 if (login_host) |
| 306 login_host->Finalize(); | 317 login_host->Finalize(); |
| 307 user_manager::UserManager::Get()->SessionStarted(); | 318 user_manager::UserManager::Get()->SessionStarted(); |
| 308 chromeos::BootTimesLoader::Get()->LoginDone( | 319 chromeos::BootTimesLoader::Get()->LoginDone( |
| 309 user_manager::UserManager::Get()->IsCurrentUserNew()); | 320 user_manager::UserManager::Get()->IsCurrentUserNew()); |
| 310 } | 321 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 CrosSettings* cros_settings = CrosSettings::Get(); | 497 CrosSettings* cros_settings = CrosSettings::Get(); |
| 487 bool allow_new_user = false; | 498 bool allow_new_user = false; |
| 488 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 499 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 489 if (allow_new_user) | 500 if (allow_new_user) |
| 490 return true; | 501 return true; |
| 491 return cros_settings->FindEmailInList( | 502 return cros_settings->FindEmailInList( |
| 492 kAccountsPrefUsers, username, wildcard_match); | 503 kAccountsPrefUsers, username, wildcard_match); |
| 493 } | 504 } |
| 494 | 505 |
| 495 } // namespace chromeos | 506 } // namespace chromeos |
| OLD | NEW |