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 20 matching lines...) Expand all Loading... |
31 #include "chrome/browser/policy/profile_policy_connector.h" | 31 #include "chrome/browser/policy/profile_policy_connector.h" |
32 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 32 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
33 #include "chrome/browser/prefs/browser_prefs.h" | 33 #include "chrome/browser/prefs/browser_prefs.h" |
34 #include "chrome/browser/prefs/pref_service_syncable.h" | 34 #include "chrome/browser/prefs/pref_service_syncable.h" |
35 #include "chrome/browser/prerender/prerender_manager.h" | 35 #include "chrome/browser/prerender/prerender_manager.h" |
36 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" | 36 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" |
37 #include "chrome/browser/profiles/profile_manager.h" | 37 #include "chrome/browser/profiles/profile_manager.h" |
38 #include "chrome/browser/profiles/storage_partition_descriptor.h" | 38 #include "chrome/browser/profiles/storage_partition_descriptor.h" |
39 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" | 39 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" |
40 #include "chrome/browser/sync/glue/sync_start_util.h" | 40 #include "chrome/browser/sync/glue/sync_start_util.h" |
| 41 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
41 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" | 42 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" |
42 #include "chrome/browser/web_data_service_factory.h" | 43 #include "chrome/browser/web_data_service_factory.h" |
43 #include "chrome/common/chrome_constants.h" | 44 #include "chrome/common/chrome_constants.h" |
44 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
45 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
46 #include "chrome/common/url_constants.h" | 47 #include "chrome/common/url_constants.h" |
47 #include "chrome/test/base/history_index_restore_observer.h" | 48 #include "chrome/test/base/history_index_restore_observer.h" |
48 #include "chrome/test/base/testing_pref_service_syncable.h" | 49 #include "chrome/test/base/testing_pref_service_syncable.h" |
49 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 50 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
50 #include "components/bookmarks/browser/bookmark_model.h" | 51 #include "components/bookmarks/browser/bookmark_model.h" |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 prefs_.reset(testing_prefs_); | 737 prefs_.reset(testing_prefs_); |
737 user_prefs::UserPrefs::Set(this, prefs_.get()); | 738 user_prefs::UserPrefs::Set(this, prefs_.get()); |
738 chrome::RegisterUserProfilePrefs(testing_prefs_->registry()); | 739 chrome::RegisterUserProfilePrefs(testing_prefs_->registry()); |
739 } | 740 } |
740 | 741 |
741 void TestingProfile::CreateIncognitoPrefService() { | 742 void TestingProfile::CreateIncognitoPrefService() { |
742 DCHECK(original_profile_); | 743 DCHECK(original_profile_); |
743 DCHECK(!testing_prefs_); | 744 DCHECK(!testing_prefs_); |
744 // Simplified version of ProfileImpl::GetOffTheRecordPrefs(). Note this | 745 // Simplified version of ProfileImpl::GetOffTheRecordPrefs(). Note this |
745 // leaves testing_prefs_ unset. | 746 // leaves testing_prefs_ unset. |
746 prefs_.reset(original_profile_->prefs_->CreateIncognitoPrefService(NULL)); | 747 prefs_.reset(original_profile_->prefs_->CreateIncognitoPrefService( |
| 748 NULL, base::Bind(&PrefsTabHelper::InitIncognitoUserPrefStore))); |
747 user_prefs::UserPrefs::Set(this, prefs_.get()); | 749 user_prefs::UserPrefs::Set(this, prefs_.get()); |
748 } | 750 } |
749 | 751 |
750 void TestingProfile::CreateProfilePolicyConnector() { | 752 void TestingProfile::CreateProfilePolicyConnector() { |
751 #if defined(ENABLE_CONFIGURATION_POLICY) | 753 #if defined(ENABLE_CONFIGURATION_POLICY) |
752 schema_registry_service_ = | 754 schema_registry_service_ = |
753 policy::SchemaRegistryServiceFactory::CreateForContext( | 755 policy::SchemaRegistryServiceFactory::CreateForContext( |
754 this, policy::Schema(), NULL); | 756 this, policy::Schema(), NULL); |
755 CHECK_EQ(schema_registry_service_.get(), | 757 CHECK_EQ(schema_registry_service_.get(), |
756 policy::SchemaRegistryServiceFactory::GetForContext(this)); | 758 policy::SchemaRegistryServiceFactory::GetForContext(this)); |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 #if defined(ENABLE_EXTENSIONS) | 1057 #if defined(ENABLE_EXTENSIONS) |
1056 extension_policy_, | 1058 extension_policy_, |
1057 #endif | 1059 #endif |
1058 pref_service_.Pass(), | 1060 pref_service_.Pass(), |
1059 original_profile, | 1061 original_profile, |
1060 guest_session_, | 1062 guest_session_, |
1061 supervised_user_id_, | 1063 supervised_user_id_, |
1062 policy_service_.Pass(), | 1064 policy_service_.Pass(), |
1063 testing_factories_); | 1065 testing_factories_); |
1064 } | 1066 } |
OLD | NEW |