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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 #if defined(OS_CHROMEOS) | 408 #if defined(OS_CHROMEOS) |
409 // An empty username means incognito user in case of ChromiumOS and | 409 // An empty username means incognito user in case of ChromiumOS and |
410 // no logged-in user in case of Chromium (SigninService). Many tests use | 410 // no logged-in user in case of Chromium (SigninService). Many tests use |
411 // nonsense email addresses (e.g. 'test') so treat those as non-enterprise | 411 // nonsense email addresses (e.g. 'test') so treat those as non-enterprise |
412 // users. | 412 // users. |
413 if (user_name.empty() || user_name.find('@') == std::string::npos) | 413 if (user_name.empty() || user_name.find('@') == std::string::npos) |
414 return USER_AFFILIATION_NONE; | 414 return USER_AFFILIATION_NONE; |
415 if (install_attributes_ && | 415 if (install_attributes_ && |
416 (gaia::ExtractDomainName(gaia::CanonicalizeEmail(user_name)) == | 416 (gaia::ExtractDomainName(gaia::CanonicalizeEmail(user_name)) == |
417 install_attributes_->GetDomain() || | 417 install_attributes_->GetDomain() || |
418 policy::IsDeviceLocalAccountUser(user_name))) { | 418 policy::IsDeviceLocalAccountUser(user_name, NULL))) { |
419 return USER_AFFILIATION_MANAGED; | 419 return USER_AFFILIATION_MANAGED; |
420 } | 420 } |
421 #endif | 421 #endif |
422 | 422 |
423 return USER_AFFILIATION_NONE; | 423 return USER_AFFILIATION_NONE; |
424 } | 424 } |
425 | 425 |
426 #if defined(OS_CHROMEOS) | 426 #if defined(OS_CHROMEOS) |
427 AppPackUpdater* BrowserPolicyConnector::GetAppPackUpdater() { | 427 AppPackUpdater* BrowserPolicyConnector::GetAppPackUpdater() { |
428 // request_context_ is NULL in unit tests. | 428 // request_context_ is NULL in unit tests. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 return new AsyncPolicyProvider(loader.Pass()); | 558 return new AsyncPolicyProvider(loader.Pass()); |
559 } else { | 559 } else { |
560 return NULL; | 560 return NULL; |
561 } | 561 } |
562 #else | 562 #else |
563 return NULL; | 563 return NULL; |
564 #endif | 564 #endif |
565 } | 565 } |
566 | 566 |
567 } // namespace policy | 567 } // namespace policy |
OLD | NEW |