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

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: Use callback_list in PolicyCertVerifier. Created 7 years, 2 months 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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 } 621 }
622 622
623 void TestingProfile::CreateProfilePolicyConnector() { 623 void TestingProfile::CreateProfilePolicyConnector() {
624 scoped_ptr<policy::PolicyService> service; 624 scoped_ptr<policy::PolicyService> service;
625 #if defined(ENABLE_CONFIGURATION_POLICY) 625 #if defined(ENABLE_CONFIGURATION_POLICY)
626 std::vector<policy::ConfigurationPolicyProvider*> providers; 626 std::vector<policy::ConfigurationPolicyProvider*> providers;
627 service.reset(new policy::PolicyServiceImpl(providers)); 627 service.reset(new policy::PolicyServiceImpl(providers));
628 #else 628 #else
629 service.reset(new policy::PolicyServiceStub()); 629 service.reset(new policy::PolicyServiceStub());
630 #endif 630 #endif
631 profile_policy_connector_.reset( 631 profile_policy_connector_.reset(new policy::ProfilePolicyConnector());
632 new policy::ProfilePolicyConnector(this));
633 profile_policy_connector_->InitForTesting(service.Pass()); 632 profile_policy_connector_->InitForTesting(service.Pass());
634 policy::ProfilePolicyConnectorFactory::GetInstance()->SetServiceForTesting( 633 policy::ProfilePolicyConnectorFactory::GetInstance()->SetServiceForTesting(
635 this, profile_policy_connector_.get()); 634 this, profile_policy_connector_.get());
636 CHECK_EQ(profile_policy_connector_.get(), 635 CHECK_EQ(profile_policy_connector_.get(),
637 policy::ProfilePolicyConnectorFactory::GetForProfile(this)); 636 policy::ProfilePolicyConnectorFactory::GetForProfile(this));
638 } 637 }
639 638
640 PrefService* TestingProfile::GetPrefs() { 639 PrefService* TestingProfile::GetPrefs() {
641 if (!prefs_.get()) { 640 if (!prefs_.get()) {
642 CreateTestingPrefService(); 641 CreateTestingPrefService();
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 DCHECK(!build_called_); 875 DCHECK(!build_called_);
877 build_called_ = true; 876 build_called_ = true;
878 return scoped_ptr<TestingProfile>(new TestingProfile( 877 return scoped_ptr<TestingProfile>(new TestingProfile(
879 path_, 878 path_,
880 delegate_, 879 delegate_,
881 extension_policy_, 880 extension_policy_,
882 pref_service_.Pass(), 881 pref_service_.Pass(),
883 incognito_, 882 incognito_,
884 testing_factories_)); 883 testing_factories_));
885 } 884 }
OLDNEW
« chrome/browser/policy/profile_policy_connector_stub.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