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/test/base/testing_profile.h" | 5 #include "chrome/test/base/testing_profile.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 } | 619 } |
620 | 620 |
621 void TestingProfile::CreateProfilePolicyConnector() { | 621 void TestingProfile::CreateProfilePolicyConnector() { |
622 scoped_ptr<policy::PolicyService> service; | 622 scoped_ptr<policy::PolicyService> service; |
623 #if defined(ENABLE_CONFIGURATION_POLICY) | 623 #if defined(ENABLE_CONFIGURATION_POLICY) |
624 std::vector<policy::ConfigurationPolicyProvider*> providers; | 624 std::vector<policy::ConfigurationPolicyProvider*> providers; |
625 service.reset(new policy::PolicyServiceImpl(providers)); | 625 service.reset(new policy::PolicyServiceImpl(providers)); |
626 #else | 626 #else |
627 service.reset(new policy::PolicyServiceStub()); | 627 service.reset(new policy::PolicyServiceStub()); |
628 #endif | 628 #endif |
629 profile_policy_connector_.reset( | 629 profile_policy_connector_.reset(new policy::ProfilePolicyConnector()); |
630 new policy::ProfilePolicyConnector(this)); | |
631 profile_policy_connector_->InitForTesting(service.Pass()); | 630 profile_policy_connector_->InitForTesting(service.Pass()); |
632 policy::ProfilePolicyConnectorFactory::GetInstance()->SetServiceForTesting( | 631 policy::ProfilePolicyConnectorFactory::GetInstance()->SetServiceForTesting( |
633 this, profile_policy_connector_.get()); | 632 this, profile_policy_connector_.get()); |
634 CHECK_EQ(profile_policy_connector_.get(), | 633 CHECK_EQ(profile_policy_connector_.get(), |
635 policy::ProfilePolicyConnectorFactory::GetForProfile(this)); | 634 policy::ProfilePolicyConnectorFactory::GetForProfile(this)); |
636 } | 635 } |
637 | 636 |
638 PrefService* TestingProfile::GetPrefs() { | 637 PrefService* TestingProfile::GetPrefs() { |
639 if (!prefs_.get()) { | 638 if (!prefs_.get()) { |
640 CreateTestingPrefService(); | 639 CreateTestingPrefService(); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 DCHECK(!build_called_); | 866 DCHECK(!build_called_); |
868 build_called_ = true; | 867 build_called_ = true; |
869 return scoped_ptr<TestingProfile>(new TestingProfile( | 868 return scoped_ptr<TestingProfile>(new TestingProfile( |
870 path_, | 869 path_, |
871 delegate_, | 870 delegate_, |
872 extension_policy_, | 871 extension_policy_, |
873 pref_service_.Pass(), | 872 pref_service_.Pass(), |
874 incognito_, | 873 incognito_, |
875 testing_factories_)); | 874 testing_factories_)); |
876 } | 875 } |
OLD | NEW |