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

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 another bug for OTRProfile. 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
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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 } 628 }
629 629
630 void TestingProfile::CreateProfilePolicyConnector() { 630 void TestingProfile::CreateProfilePolicyConnector() {
631 scoped_ptr<policy::PolicyService> service; 631 scoped_ptr<policy::PolicyService> service;
632 #if defined(ENABLE_CONFIGURATION_POLICY) 632 #if defined(ENABLE_CONFIGURATION_POLICY)
633 std::vector<policy::ConfigurationPolicyProvider*> providers; 633 std::vector<policy::ConfigurationPolicyProvider*> providers;
634 service.reset(new policy::PolicyServiceImpl(providers)); 634 service.reset(new policy::PolicyServiceImpl(providers));
635 #else 635 #else
636 service.reset(new policy::PolicyServiceStub()); 636 service.reset(new policy::PolicyServiceStub());
637 #endif 637 #endif
638 profile_policy_connector_.reset( 638 profile_policy_connector_.reset(new policy::ProfilePolicyConnector());
639 new policy::ProfilePolicyConnector(this));
640 profile_policy_connector_->InitForTesting(service.Pass()); 639 profile_policy_connector_->InitForTesting(service.Pass());
641 policy::ProfilePolicyConnectorFactory::GetInstance()->SetServiceForTesting( 640 policy::ProfilePolicyConnectorFactory::GetInstance()->SetServiceForTesting(
642 this, profile_policy_connector_.get()); 641 this, profile_policy_connector_.get());
643 CHECK_EQ(profile_policy_connector_.get(), 642 CHECK_EQ(profile_policy_connector_.get(),
644 policy::ProfilePolicyConnectorFactory::GetForProfile(this)); 643 policy::ProfilePolicyConnectorFactory::GetForProfile(this));
645 } 644 }
646 645
647 PrefService* TestingProfile::GetPrefs() { 646 PrefService* TestingProfile::GetPrefs() {
648 if (!prefs_.get()) { 647 if (!prefs_.get()) {
649 CreateTestingPrefService(); 648 CreateTestingPrefService();
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« chrome/browser/profiles/profile_io_data.cc ('K') | « chrome/chrome_browser_chromeos.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698