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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 } | 626 } |
627 | 627 |
628 void TestingProfile::CreateProfilePolicyConnector() { | 628 void TestingProfile::CreateProfilePolicyConnector() { |
629 scoped_ptr<policy::PolicyService> service; | 629 scoped_ptr<policy::PolicyService> service; |
630 #if defined(ENABLE_CONFIGURATION_POLICY) | 630 #if defined(ENABLE_CONFIGURATION_POLICY) |
631 std::vector<policy::ConfigurationPolicyProvider*> providers; | 631 std::vector<policy::ConfigurationPolicyProvider*> providers; |
632 service.reset(new policy::PolicyServiceImpl(providers)); | 632 service.reset(new policy::PolicyServiceImpl(providers)); |
633 #else | 633 #else |
634 service.reset(new policy::PolicyServiceStub()); | 634 service.reset(new policy::PolicyServiceStub()); |
635 #endif | 635 #endif |
636 profile_policy_connector_.reset( | 636 profile_policy_connector_.reset(new policy::ProfilePolicyConnector()); |
637 new policy::ProfilePolicyConnector(this)); | |
638 profile_policy_connector_->InitForTesting(service.Pass()); | 637 profile_policy_connector_->InitForTesting(service.Pass()); |
639 policy::ProfilePolicyConnectorFactory::GetInstance()->SetServiceForTesting( | 638 policy::ProfilePolicyConnectorFactory::GetInstance()->SetServiceForTesting( |
640 this, profile_policy_connector_.get()); | 639 this, profile_policy_connector_.get()); |
641 CHECK_EQ(profile_policy_connector_.get(), | 640 CHECK_EQ(profile_policy_connector_.get(), |
642 policy::ProfilePolicyConnectorFactory::GetForProfile(this)); | 641 policy::ProfilePolicyConnectorFactory::GetForProfile(this)); |
643 } | 642 } |
644 | 643 |
645 PrefService* TestingProfile::GetPrefs() { | 644 PrefService* TestingProfile::GetPrefs() { |
646 if (!prefs_.get()) { | 645 if (!prefs_.get()) { |
647 CreateTestingPrefService(); | 646 CreateTestingPrefService(); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 | 889 |
891 return scoped_ptr<TestingProfile>(new TestingProfile( | 890 return scoped_ptr<TestingProfile>(new TestingProfile( |
892 path_, | 891 path_, |
893 delegate_, | 892 delegate_, |
894 extension_policy_, | 893 extension_policy_, |
895 pref_service_.Pass(), | 894 pref_service_.Pass(), |
896 incognito_, | 895 incognito_, |
897 managed_user_id_, | 896 managed_user_id_, |
898 testing_factories_)); | 897 testing_factories_)); |
899 } | 898 } |
OLD | NEW |