| 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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Profile::RegisterUserPrefs(testing_prefs_->registry()); | 559 Profile::RegisterUserPrefs(testing_prefs_->registry()); |
| 560 chrome::RegisterUserPrefs(testing_prefs_, testing_prefs_->registry()); | 560 chrome::RegisterUserPrefs(testing_prefs_->registry()); |
| 561 } | 561 } |
| 562 | 562 |
| 563 PrefService* TestingProfile::GetPrefs() { | 563 PrefService* TestingProfile::GetPrefs() { |
| 564 if (!prefs_.get()) { | 564 if (!prefs_.get()) { |
| 565 CreateTestingPrefService(); | 565 CreateTestingPrefService(); |
| 566 } | 566 } |
| 567 return prefs_.get(); | 567 return prefs_.get(); |
| 568 } | 568 } |
| 569 | 569 |
| 570 history::TopSites* TestingProfile::GetTopSites() { | 570 history::TopSites* TestingProfile::GetTopSites() { |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 | 810 |
| 811 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { | 811 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { |
| 812 DCHECK(!build_called_); | 812 DCHECK(!build_called_); |
| 813 build_called_ = true; | 813 build_called_ = true; |
| 814 return scoped_ptr<TestingProfile>(new TestingProfile( | 814 return scoped_ptr<TestingProfile>(new TestingProfile( |
| 815 path_, | 815 path_, |
| 816 delegate_, | 816 delegate_, |
| 817 extension_policy_, | 817 extension_policy_, |
| 818 pref_service_.Pass())); | 818 pref_service_.Pass())); |
| 819 } | 819 } |
| OLD | NEW |