| 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/policy/browser_policy_connector.h" | 5 #include "chrome/browser/policy/browser_policy_connector.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 #if defined(OS_CHROMEOS) | 400 #if defined(OS_CHROMEOS) |
| 401 // An empty username means incognito user in case of ChromiumOS and | 401 // An empty username means incognito user in case of ChromiumOS and |
| 402 // no logged-in user in case of Chromium (SigninService). Many tests use | 402 // no logged-in user in case of Chromium (SigninService). Many tests use |
| 403 // nonsense email addresses (e.g. 'test') so treat those as non-enterprise | 403 // nonsense email addresses (e.g. 'test') so treat those as non-enterprise |
| 404 // users. | 404 // users. |
| 405 if (user_name.empty() || user_name.find('@') == std::string::npos) | 405 if (user_name.empty() || user_name.find('@') == std::string::npos) |
| 406 return USER_AFFILIATION_NONE; | 406 return USER_AFFILIATION_NONE; |
| 407 if (install_attributes_ && | 407 if (install_attributes_ && |
| 408 (gaia::ExtractDomainName(gaia::CanonicalizeEmail(user_name)) == | 408 (gaia::ExtractDomainName(gaia::CanonicalizeEmail(user_name)) == |
| 409 install_attributes_->GetDomain() || | 409 install_attributes_->GetDomain() || |
| 410 policy::IsDeviceLocalAccountUser(user_name))) { | 410 policy::IsDeviceLocalAccountUser(user_name, NULL))) { |
| 411 return USER_AFFILIATION_MANAGED; | 411 return USER_AFFILIATION_MANAGED; |
| 412 } | 412 } |
| 413 #endif | 413 #endif |
| 414 | 414 |
| 415 return USER_AFFILIATION_NONE; | 415 return USER_AFFILIATION_NONE; |
| 416 } | 416 } |
| 417 | 417 |
| 418 #if defined(OS_CHROMEOS) | 418 #if defined(OS_CHROMEOS) |
| 419 AppPackUpdater* BrowserPolicyConnector::GetAppPackUpdater() { | 419 AppPackUpdater* BrowserPolicyConnector::GetAppPackUpdater() { |
| 420 // request_context_ is NULL in unit tests. | 420 // request_context_ is NULL in unit tests. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 return new AsyncPolicyProvider(loader.Pass()); | 550 return new AsyncPolicyProvider(loader.Pass()); |
| 551 } else { | 551 } else { |
| 552 return NULL; | 552 return NULL; |
| 553 } | 553 } |
| 554 #else | 554 #else |
| 555 return NULL; | 555 return NULL; |
| 556 #endif | 556 #endif |
| 557 } | 557 } |
| 558 | 558 |
| 559 } // namespace policy | 559 } // namespace policy |
| OLD | NEW |