| 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/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "chrome/browser/policy/profile_policy_connector.h" | 37 #include "chrome/browser/policy/profile_policy_connector.h" |
| 38 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 38 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 39 #include "chrome/browser/prefs/browser_prefs.h" | 39 #include "chrome/browser/prefs/browser_prefs.h" |
| 40 #include "chrome/browser/prefs/pref_service_syncable.h" | 40 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 41 #include "chrome/browser/prerender/prerender_manager.h" | 41 #include "chrome/browser/prerender/prerender_manager.h" |
| 42 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" | 42 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" |
| 43 #include "chrome/browser/profiles/profile_manager.h" | 43 #include "chrome/browser/profiles/profile_manager.h" |
| 44 #include "chrome/browser/profiles/storage_partition_descriptor.h" | 44 #include "chrome/browser/profiles/storage_partition_descriptor.h" |
| 45 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" | 45 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" |
| 46 #include "chrome/browser/sync/glue/sync_start_util.h" | 46 #include "chrome/browser/sync/glue/sync_start_util.h" |
| 47 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" |
| 47 #include "chrome/browser/webdata/web_data_service_factory.h" | 48 #include "chrome/browser/webdata/web_data_service_factory.h" |
| 48 #include "chrome/common/chrome_constants.h" | 49 #include "chrome/common/chrome_constants.h" |
| 49 #include "chrome/common/chrome_switches.h" | 50 #include "chrome/common/chrome_switches.h" |
| 50 #include "chrome/common/pref_names.h" | 51 #include "chrome/common/pref_names.h" |
| 51 #include "chrome/common/url_constants.h" | 52 #include "chrome/common/url_constants.h" |
| 52 #include "chrome/test/base/history_index_restore_observer.h" | 53 #include "chrome/test/base/history_index_restore_observer.h" |
| 53 #include "chrome/test/base/testing_pref_service_syncable.h" | 54 #include "chrome/test/base/testing_pref_service_syncable.h" |
| 54 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 55 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 55 #include "components/bookmarks/browser/bookmark_model.h" | 56 #include "components/bookmarks/browser/bookmark_model.h" |
| 56 #include "components/bookmarks/common/bookmark_constants.h" | 57 #include "components/bookmarks/common/bookmark_constants.h" |
| 57 #include "components/content_settings/core/browser/host_content_settings_map.h" | 58 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 58 #include "components/history/content/browser/history_database_helper.h" | 59 #include "components/history/content/browser/history_database_helper.h" |
| 59 #include "components/history/core/browser/history_constants.h" | 60 #include "components/history/core/browser/history_constants.h" |
| 60 #include "components/history/core/browser/history_database_params.h" | 61 #include "components/history/core/browser/history_database_params.h" |
| 61 #include "components/history/core/browser/history_db_task.h" | 62 #include "components/history/core/browser/history_db_task.h" |
| 62 #include "components/history/core/browser/top_sites.h" | 63 #include "components/history/core/browser/top_sites.h" |
| 63 #include "components/history/core/browser/top_sites_observer.h" | 64 #include "components/history/core/browser/top_sites_observer.h" |
| 64 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 65 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 65 #include "components/keyed_service/core/refcounted_keyed_service.h" | 66 #include "components/keyed_service/core/refcounted_keyed_service.h" |
| 66 #include "components/policy/core/common/policy_service.h" | 67 #include "components/policy/core/common/policy_service.h" |
| 68 #include "components/ui/zoom/zoom_event_manager.h" |
| 67 #include "components/user_prefs/user_prefs.h" | 69 #include "components/user_prefs/user_prefs.h" |
| 68 #include "components/webdata_services/web_data_service_wrapper.h" | 70 #include "components/webdata_services/web_data_service_wrapper.h" |
| 69 #include "content/public/browser/browser_thread.h" | 71 #include "content/public/browser/browser_thread.h" |
| 70 #include "content/public/browser/cookie_store_factory.h" | 72 #include "content/public/browser/cookie_store_factory.h" |
| 71 #include "content/public/browser/notification_service.h" | 73 #include "content/public/browser/notification_service.h" |
| 72 #include "content/public/browser/render_process_host.h" | 74 #include "content/public/browser/render_process_host.h" |
| 73 #include "content/public/browser/storage_partition.h" | 75 #include "content/public/browser/storage_partition.h" |
| 76 #include "content/public/browser/zoom_level_delegate.h" |
| 74 #include "content/public/test/mock_resource_context.h" | 77 #include "content/public/test/mock_resource_context.h" |
| 75 #include "content/public/test/test_utils.h" | 78 #include "content/public/test/test_utils.h" |
| 76 #include "extensions/common/constants.h" | 79 #include "extensions/common/constants.h" |
| 77 #include "net/cookies/cookie_monster.h" | 80 #include "net/cookies/cookie_monster.h" |
| 78 #include "net/url_request/url_request_context.h" | 81 #include "net/url_request/url_request_context.h" |
| 79 #include "net/url_request/url_request_context_getter.h" | 82 #include "net/url_request/url_request_context_getter.h" |
| 80 #include "net/url_request/url_request_test_util.h" | 83 #include "net/url_request/url_request_test_util.h" |
| 81 #include "testing/gmock/include/gmock/gmock.h" | 84 #include "testing/gmock/include/gmock/gmock.h" |
| 82 | 85 |
| 83 #if defined(ENABLE_CONFIGURATION_POLICY) | 86 #if defined(ENABLE_CONFIGURATION_POLICY) |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 void TestingProfile::SetGuestSession(bool guest) { | 675 void TestingProfile::SetGuestSession(bool guest) { |
| 673 guest_session_ = guest; | 676 guest_session_ = guest; |
| 674 } | 677 } |
| 675 | 678 |
| 676 base::FilePath TestingProfile::GetPath() const { | 679 base::FilePath TestingProfile::GetPath() const { |
| 677 return profile_path_; | 680 return profile_path_; |
| 678 } | 681 } |
| 679 | 682 |
| 680 scoped_ptr<content::ZoomLevelDelegate> TestingProfile::CreateZoomLevelDelegate( | 683 scoped_ptr<content::ZoomLevelDelegate> TestingProfile::CreateZoomLevelDelegate( |
| 681 const base::FilePath& partition_path) { | 684 const base::FilePath& partition_path) { |
| 682 return nullptr; | 685 return make_scoped_ptr(new chrome::ChromeZoomLevelPrefs( |
| 686 GetPrefs(), GetPath(), partition_path, |
| 687 ui_zoom::ZoomEventManager::GetForBrowserContext(this)->GetWeakPtr())); |
| 683 } | 688 } |
| 684 | 689 |
| 685 scoped_refptr<base::SequencedTaskRunner> TestingProfile::GetIOTaskRunner() { | 690 scoped_refptr<base::SequencedTaskRunner> TestingProfile::GetIOTaskRunner() { |
| 686 return base::MessageLoop::current()->message_loop_proxy(); | 691 return base::MessageLoop::current()->message_loop_proxy(); |
| 687 } | 692 } |
| 688 | 693 |
| 689 TestingPrefServiceSyncable* TestingProfile::GetTestingPrefService() { | 694 TestingPrefServiceSyncable* TestingProfile::GetTestingPrefService() { |
| 690 DCHECK(prefs_); | 695 DCHECK(prefs_); |
| 691 DCHECK(testing_prefs_); | 696 DCHECK(testing_prefs_); |
| 692 return testing_prefs_; | 697 return testing_prefs_; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 PrefService* TestingProfile::GetPrefs() { | 827 PrefService* TestingProfile::GetPrefs() { |
| 823 DCHECK(prefs_); | 828 DCHECK(prefs_); |
| 824 return prefs_.get(); | 829 return prefs_.get(); |
| 825 } | 830 } |
| 826 | 831 |
| 827 const PrefService* TestingProfile::GetPrefs() const { | 832 const PrefService* TestingProfile::GetPrefs() const { |
| 828 DCHECK(prefs_); | 833 DCHECK(prefs_); |
| 829 return prefs_.get(); | 834 return prefs_.get(); |
| 830 } | 835 } |
| 831 | 836 |
| 837 chrome::ChromeZoomLevelPrefs* TestingProfile::GetZoomLevelPrefs() { |
| 838 return static_cast<chrome::ChromeZoomLevelPrefs*>( |
| 839 GetDefaultStoragePartition(this)->GetZoomLevelDelegate()); |
| 840 } |
| 841 |
| 832 DownloadManagerDelegate* TestingProfile::GetDownloadManagerDelegate() { | 842 DownloadManagerDelegate* TestingProfile::GetDownloadManagerDelegate() { |
| 833 return NULL; | 843 return NULL; |
| 834 } | 844 } |
| 835 | 845 |
| 836 net::URLRequestContextGetter* TestingProfile::GetRequestContext() { | 846 net::URLRequestContextGetter* TestingProfile::GetRequestContext() { |
| 837 return GetDefaultStoragePartition(this)->GetURLRequestContext(); | 847 return GetDefaultStoragePartition(this)->GetURLRequestContext(); |
| 838 } | 848 } |
| 839 | 849 |
| 840 net::URLRequestContextGetter* TestingProfile::CreateRequestContext( | 850 net::URLRequestContextGetter* TestingProfile::CreateRequestContext( |
| 841 content::ProtocolHandlerMap* protocol_handlers, | 851 content::ProtocolHandlerMap* protocol_handlers, |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 #if defined(ENABLE_EXTENSIONS) | 1101 #if defined(ENABLE_EXTENSIONS) |
| 1092 extension_policy_, | 1102 extension_policy_, |
| 1093 #endif | 1103 #endif |
| 1094 pref_service_.Pass(), | 1104 pref_service_.Pass(), |
| 1095 original_profile, | 1105 original_profile, |
| 1096 guest_session_, | 1106 guest_session_, |
| 1097 supervised_user_id_, | 1107 supervised_user_id_, |
| 1098 policy_service_.Pass(), | 1108 policy_service_.Pass(), |
| 1099 testing_factories_); | 1109 testing_factories_); |
| 1100 } | 1110 } |
| OLD | NEW |