Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: chrome/test/base/testing_profile.cc

Issue 24153012: Fix cyclic dependency between ProfilePolicyConnector and PrefService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_browser_chromeos.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 policy::SchemaRegistryServiceFactory::CreateForContext( 634 policy::SchemaRegistryServiceFactory::CreateForContext(
635 this, policy::Schema(), NULL); 635 this, policy::Schema(), NULL);
636 CHECK_EQ(schema_registry_service_.get(), 636 CHECK_EQ(schema_registry_service_.get(),
637 policy::SchemaRegistryServiceFactory::GetForContext(this)); 637 policy::SchemaRegistryServiceFactory::GetForContext(this));
638 638
639 std::vector<policy::ConfigurationPolicyProvider*> providers; 639 std::vector<policy::ConfigurationPolicyProvider*> providers;
640 service.reset(new policy::PolicyServiceImpl(providers)); 640 service.reset(new policy::PolicyServiceImpl(providers));
641 #else 641 #else
642 service.reset(new policy::PolicyServiceStub()); 642 service.reset(new policy::PolicyServiceStub());
643 #endif 643 #endif
644 profile_policy_connector_.reset( 644 profile_policy_connector_.reset(new policy::ProfilePolicyConnector());
645 new policy::ProfilePolicyConnector(this));
646 profile_policy_connector_->InitForTesting(service.Pass()); 645 profile_policy_connector_->InitForTesting(service.Pass());
647 policy::ProfilePolicyConnectorFactory::GetInstance()->SetServiceForTesting( 646 policy::ProfilePolicyConnectorFactory::GetInstance()->SetServiceForTesting(
648 this, profile_policy_connector_.get()); 647 this, profile_policy_connector_.get());
649 CHECK_EQ(profile_policy_connector_.get(), 648 CHECK_EQ(profile_policy_connector_.get(),
650 policy::ProfilePolicyConnectorFactory::GetForProfile(this)); 649 policy::ProfilePolicyConnectorFactory::GetForProfile(this));
651 } 650 }
652 651
653 PrefService* TestingProfile::GetPrefs() { 652 PrefService* TestingProfile::GetPrefs() {
654 if (!prefs_.get()) { 653 if (!prefs_.get()) {
655 CreateTestingPrefService(); 654 CreateTestingPrefService();
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 897
899 return scoped_ptr<TestingProfile>(new TestingProfile( 898 return scoped_ptr<TestingProfile>(new TestingProfile(
900 path_, 899 path_,
901 delegate_, 900 delegate_,
902 extension_policy_, 901 extension_policy_,
903 pref_service_.Pass(), 902 pref_service_.Pass(),
904 incognito_, 903 incognito_,
905 managed_user_id_, 904 managed_user_id_,
906 testing_factories_)); 905 testing_factories_));
907 } 906 }
OLDNEW
« no previous file with comments | « chrome/chrome_browser_chromeos.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698