| 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 policy_service_.reset(new policy::PolicyServiceStub()); | 549 policy_service_.reset(new policy::PolicyServiceStub()); |
| 550 #endif | 550 #endif |
| 551 } | 551 } |
| 552 return policy_service_.get(); | 552 return policy_service_.get(); |
| 553 } | 553 } |
| 554 | 554 |
| 555 void TestingProfile::CreateTestingPrefService() { | 555 void TestingProfile::CreateTestingPrefService() { |
| 556 DCHECK(!prefs_.get()); | 556 DCHECK(!prefs_.get()); |
| 557 testing_prefs_ = new TestingPrefServiceSyncable(); | 557 testing_prefs_ = new TestingPrefServiceSyncable(); |
| 558 prefs_.reset(testing_prefs_); | 558 prefs_.reset(testing_prefs_); |
| 559 chrome::RegisterUserPrefs(testing_prefs_, testing_prefs_->registry()); | 559 chrome::RegisterUserPrefs(testing_prefs_->registry()); |
| 560 } | 560 } |
| 561 | 561 |
| 562 PrefService* TestingProfile::GetPrefs() { | 562 PrefService* TestingProfile::GetPrefs() { |
| 563 if (!prefs_.get()) { | 563 if (!prefs_.get()) { |
| 564 CreateTestingPrefService(); | 564 CreateTestingPrefService(); |
| 565 } | 565 } |
| 566 return prefs_.get(); | 566 return prefs_.get(); |
| 567 } | 567 } |
| 568 | 568 |
| 569 history::TopSites* TestingProfile::GetTopSites() { | 569 history::TopSites* TestingProfile::GetTopSites() { |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 | 809 |
| 810 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { | 810 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { |
| 811 DCHECK(!build_called_); | 811 DCHECK(!build_called_); |
| 812 build_called_ = true; | 812 build_called_ = true; |
| 813 return scoped_ptr<TestingProfile>(new TestingProfile( | 813 return scoped_ptr<TestingProfile>(new TestingProfile( |
| 814 path_, | 814 path_, |
| 815 delegate_, | 815 delegate_, |
| 816 extension_policy_, | 816 extension_policy_, |
| 817 pref_service_.Pass())); | 817 pref_service_.Pass())); |
| 818 } | 818 } |
| OLD | NEW |