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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/chromeos/chromeos_version.h" | 10 #include "base/chromeos/chromeos_version.h" |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 #if defined(ENABLE_RLZ) | 542 #if defined(ENABLE_RLZ) |
543 if (!g_browser_process->local_state()->HasPrefPath(prefs::kRLZBrand)) { | 543 if (!g_browser_process->local_state()->HasPrefPath(prefs::kRLZBrand)) { |
544 // Read brand code asynchronously from an OEM file and repost ourselves. | 544 // Read brand code asynchronously from an OEM file and repost ourselves. |
545 google_util::chromeos::SetBrandFromFile( | 545 google_util::chromeos::SetBrandFromFile( |
546 base::Bind(&LoginUtilsImpl::InitRlzDelayed, AsWeakPtr(), user_profile)); | 546 base::Bind(&LoginUtilsImpl::InitRlzDelayed, AsWeakPtr(), user_profile)); |
547 return; | 547 return; |
548 } | 548 } |
549 base::PostTaskAndReplyWithResult( | 549 base::PostTaskAndReplyWithResult( |
550 base::WorkerPool::GetTaskRunner(false), | 550 base::WorkerPool::GetTaskRunner(false), |
551 FROM_HERE, | 551 FROM_HERE, |
552 base::Bind(&file_util::PathExists, GetRlzDisabledFlagPath()), | 552 base::Bind(&base::PathExists, GetRlzDisabledFlagPath()), |
553 base::Bind(&LoginUtilsImpl::InitRlz, AsWeakPtr(), user_profile)); | 553 base::Bind(&LoginUtilsImpl::InitRlz, AsWeakPtr(), user_profile)); |
554 #endif | 554 #endif |
555 } | 555 } |
556 | 556 |
557 void LoginUtilsImpl::InitRlz(Profile* user_profile, bool disabled) { | 557 void LoginUtilsImpl::InitRlz(Profile* user_profile, bool disabled) { |
558 #if defined(ENABLE_RLZ) | 558 #if defined(ENABLE_RLZ) |
559 PrefService* local_state = g_browser_process->local_state(); | 559 PrefService* local_state = g_browser_process->local_state(); |
560 if (disabled) { | 560 if (disabled) { |
561 // Empty brand code means an organic install (no RLZ pings are sent). | 561 // Empty brand code means an organic install (no RLZ pings are sent). |
562 google_util::chromeos::ClearBrandForCurrentSession(); | 562 google_util::chromeos::ClearBrandForCurrentSession(); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 bool LoginUtils::IsWhitelisted(const std::string& username) { | 798 bool LoginUtils::IsWhitelisted(const std::string& username) { |
799 CrosSettings* cros_settings = CrosSettings::Get(); | 799 CrosSettings* cros_settings = CrosSettings::Get(); |
800 bool allow_new_user = false; | 800 bool allow_new_user = false; |
801 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 801 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
802 if (allow_new_user) | 802 if (allow_new_user) |
803 return true; | 803 return true; |
804 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 804 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
805 } | 805 } |
806 | 806 |
807 } // namespace chromeos | 807 } // namespace chromeos |
OLD | NEW |