| 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 "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/browser/favicon/fallback_icon_service_factory.h" | 26 #include "chrome/browser/favicon/fallback_icon_service_factory.h" |
| 27 #include "chrome/browser/favicon/favicon_service_factory.h" | 27 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 28 #include "chrome/browser/history/chrome_history_client.h" | 28 #include "chrome/browser/history/chrome_history_client.h" |
| 29 #include "chrome/browser/history/history_service_factory.h" | 29 #include "chrome/browser/history/history_service_factory.h" |
| 30 #include "chrome/browser/history/web_history_service_factory.h" | 30 #include "chrome/browser/history/web_history_service_factory.h" |
| 31 #include "chrome/browser/net/proxy_service_factory.h" | 31 #include "chrome/browser/net/proxy_service_factory.h" |
| 32 #include "chrome/browser/policy/profile_policy_connector.h" | 32 #include "chrome/browser/policy/profile_policy_connector.h" |
| 33 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 33 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 34 #include "chrome/browser/prefs/browser_prefs.h" | 34 #include "chrome/browser/prefs/browser_prefs.h" |
| 35 #include "chrome/browser/prefs/pref_service_syncable.h" | 35 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 36 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
| 36 #include "chrome/browser/prerender/prerender_manager.h" | 37 #include "chrome/browser/prerender/prerender_manager.h" |
| 37 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" | 38 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" |
| 38 #include "chrome/browser/profiles/profile_manager.h" | 39 #include "chrome/browser/profiles/profile_manager.h" |
| 39 #include "chrome/browser/profiles/storage_partition_descriptor.h" | 40 #include "chrome/browser/profiles/storage_partition_descriptor.h" |
| 40 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" | 41 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" |
| 41 #include "chrome/browser/sync/glue/sync_start_util.h" | 42 #include "chrome/browser/sync/glue/sync_start_util.h" |
| 42 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" | 43 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" |
| 43 #include "chrome/browser/web_data_service_factory.h" | 44 #include "chrome/browser/web_data_service_factory.h" |
| 44 #include "chrome/common/chrome_constants.h" | 45 #include "chrome/common/chrome_constants.h" |
| 45 #include "chrome/common/chrome_switches.h" | 46 #include "chrome/common/chrome_switches.h" |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 prefs_.reset(testing_prefs_); | 738 prefs_.reset(testing_prefs_); |
| 738 user_prefs::UserPrefs::Set(this, prefs_.get()); | 739 user_prefs::UserPrefs::Set(this, prefs_.get()); |
| 739 chrome::RegisterUserProfilePrefs(testing_prefs_->registry()); | 740 chrome::RegisterUserProfilePrefs(testing_prefs_->registry()); |
| 740 } | 741 } |
| 741 | 742 |
| 742 void TestingProfile::CreateIncognitoPrefService() { | 743 void TestingProfile::CreateIncognitoPrefService() { |
| 743 DCHECK(original_profile_); | 744 DCHECK(original_profile_); |
| 744 DCHECK(!testing_prefs_); | 745 DCHECK(!testing_prefs_); |
| 745 // Simplified version of ProfileImpl::GetOffTheRecordPrefs(). Note this | 746 // Simplified version of ProfileImpl::GetOffTheRecordPrefs(). Note this |
| 746 // leaves testing_prefs_ unset. | 747 // leaves testing_prefs_ unset. |
| 747 prefs_.reset(original_profile_->prefs_->CreateIncognitoPrefService(NULL)); | 748 prefs_.reset(CreateIncognitoPrefServiceSyncable( |
| 749 original_profile_->prefs_.get(), NULL)); |
| 748 user_prefs::UserPrefs::Set(this, prefs_.get()); | 750 user_prefs::UserPrefs::Set(this, prefs_.get()); |
| 749 } | 751 } |
| 750 | 752 |
| 751 void TestingProfile::CreateProfilePolicyConnector() { | 753 void TestingProfile::CreateProfilePolicyConnector() { |
| 752 #if defined(ENABLE_CONFIGURATION_POLICY) | 754 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 753 schema_registry_service_ = | 755 schema_registry_service_ = |
| 754 policy::SchemaRegistryServiceFactory::CreateForContext( | 756 policy::SchemaRegistryServiceFactory::CreateForContext( |
| 755 this, policy::Schema(), NULL); | 757 this, policy::Schema(), NULL); |
| 756 CHECK_EQ(schema_registry_service_.get(), | 758 CHECK_EQ(schema_registry_service_.get(), |
| 757 policy::SchemaRegistryServiceFactory::GetForContext(this)); | 759 policy::SchemaRegistryServiceFactory::GetForContext(this)); |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 #if defined(ENABLE_EXTENSIONS) | 1048 #if defined(ENABLE_EXTENSIONS) |
| 1047 extension_policy_, | 1049 extension_policy_, |
| 1048 #endif | 1050 #endif |
| 1049 pref_service_.Pass(), | 1051 pref_service_.Pass(), |
| 1050 original_profile, | 1052 original_profile, |
| 1051 guest_session_, | 1053 guest_session_, |
| 1052 supervised_user_id_, | 1054 supervised_user_id_, |
| 1053 policy_service_.Pass(), | 1055 policy_service_.Pass(), |
| 1054 testing_factories_); | 1056 testing_factories_); |
| 1055 } | 1057 } |
| OLD | NEW |