| 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "base/values.h" | 6 #include "base/values.h" |
| 7 #include "chrome/browser/content_settings/cookie_settings.h" | 7 #include "chrome/browser/content_settings/cookie_settings.h" |
| 8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/prefs/pref_service_syncable.h" | 10 #include "chrome/browser/prefs/pref_service_syncable.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 set_signin_names_for_testing(new SigninNamesOnIOThread()); | 76 set_signin_names_for_testing(new SigninNamesOnIOThread()); |
| 77 SetCookieSettingsForTesting(cookie_settings); | 77 SetCookieSettingsForTesting(cookie_settings); |
| 78 } | 78 } |
| 79 | 79 |
| 80 virtual ~TestProfileIOData() { | 80 virtual ~TestProfileIOData() { |
| 81 signin_names()->ReleaseResourcesOnUIThread(); | 81 signin_names()->ReleaseResourcesOnUIThread(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 // ProfileIOData overrides: | 84 // ProfileIOData overrides: |
| 85 virtual void LazyInitializeInternal( | 85 virtual void InitializeInternal( |
| 86 ProfileParams* profile_params) const OVERRIDE { | 86 ProfileParams* profile_params, |
| 87 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 88 blob_protocol_handler, |
| 89 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 90 file_system_protocol_handler, |
| 91 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 92 developer_protocol_handler, |
| 93 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 94 chrome_protocol_handler, |
| 95 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 96 chrome_devtools_protocol_handler) const OVERRIDE { |
| 87 NOTREACHED(); | 97 NOTREACHED(); |
| 88 } | 98 } |
| 89 virtual void InitializeExtensionsRequestContext( | 99 virtual void InitializeExtensionsRequestContext( |
| 90 ProfileParams* profile_params) const OVERRIDE { | 100 ProfileParams* profile_params) const OVERRIDE { |
| 91 NOTREACHED(); | 101 NOTREACHED(); |
| 92 } | 102 } |
| 93 virtual ChromeURLRequestContext* InitializeAppRequestContext( | 103 virtual ChromeURLRequestContext* InitializeAppRequestContext( |
| 94 ChromeURLRequestContext* main_context, | 104 ChromeURLRequestContext* main_context, |
| 95 const StoragePartitionDescriptor& details, | 105 const StoragePartitionDescriptor& details, |
| 96 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 106 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 97 protocol_handler_interceptor) const OVERRIDE { | 107 protocol_handler_interceptor, |
| 108 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 109 blob_protocol_handler, |
| 110 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 111 file_system_protocol_handler, |
| 112 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 113 developer_protocol_handler, |
| 114 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 115 chrome_protocol_handler, |
| 116 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 117 chrome_devtools_protocol_handler) const OVERRIDE { |
| 98 NOTREACHED(); | 118 NOTREACHED(); |
| 99 return NULL; | 119 return NULL; |
| 100 } | 120 } |
| 101 virtual ChromeURLRequestContext* InitializeMediaRequestContext( | 121 virtual ChromeURLRequestContext* InitializeMediaRequestContext( |
| 102 ChromeURLRequestContext* original_context, | 122 ChromeURLRequestContext* original_context, |
| 103 const StoragePartitionDescriptor& details) const OVERRIDE { | 123 const StoragePartitionDescriptor& details) const OVERRIDE { |
| 104 NOTREACHED(); | 124 NOTREACHED(); |
| 105 return NULL; | 125 return NULL; |
| 106 } | 126 } |
| 107 virtual ChromeURLRequestContext* | 127 virtual ChromeURLRequestContext* |
| 108 AcquireMediaRequestContext() const OVERRIDE { | 128 AcquireMediaRequestContext() const OVERRIDE { |
| 109 NOTREACHED(); | 129 NOTREACHED(); |
| 110 return NULL; | 130 return NULL; |
| 111 } | 131 } |
| 112 virtual ChromeURLRequestContext* | 132 virtual ChromeURLRequestContext* |
| 113 AcquireIsolatedAppRequestContext( | 133 AcquireIsolatedAppRequestContext( |
| 114 ChromeURLRequestContext* main_context, | 134 ChromeURLRequestContext* main_context, |
| 115 const StoragePartitionDescriptor& partition_descriptor, | 135 const StoragePartitionDescriptor& partition_descriptor, |
| 116 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 136 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 117 protocol_handler_interceptor) const OVERRIDE { | 137 protocol_handler_interceptor, |
| 138 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 139 blob_protocol_handler, |
| 140 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 141 file_system_protocol_handler, |
| 142 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 143 developer_protocol_handler, |
| 144 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 145 chrome_protocol_handler, |
| 146 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 147 chrome_devtools_protocol_handler) const OVERRIDE { |
| 118 NOTREACHED(); | 148 NOTREACHED(); |
| 119 return NULL; | 149 return NULL; |
| 120 } | 150 } |
| 121 virtual ChromeURLRequestContext* | 151 virtual ChromeURLRequestContext* |
| 122 AcquireIsolatedMediaRequestContext( | 152 AcquireIsolatedMediaRequestContext( |
| 123 ChromeURLRequestContext* app_context, | 153 ChromeURLRequestContext* app_context, |
| 124 const StoragePartitionDescriptor& partition_descriptor) | 154 const StoragePartitionDescriptor& partition_descriptor) |
| 125 const OVERRIDE { | 155 const OVERRIDE { |
| 126 NOTREACHED(); | 156 NOTREACHED(); |
| 127 return NULL; | 157 return NULL; |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 valid_gaia_url_, "", &request_, io_data.get())); | 721 valid_gaia_url_, "", &request_, io_data.get())); |
| 692 | 722 |
| 693 // Simulate a policy disabling sync by writing kSyncManaged directly. | 723 // Simulate a policy disabling sync by writing kSyncManaged directly. |
| 694 // We should still offer to sign in the browser. | 724 // We should still offer to sign in the browser. |
| 695 profile_->GetTestingPrefService()->SetManagedPref( | 725 profile_->GetTestingPrefService()->SetManagedPref( |
| 696 prefs::kSyncManaged, base::Value::CreateBooleanValue(true)); | 726 prefs::kSyncManaged, base::Value::CreateBooleanValue(true)); |
| 697 EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, | 727 EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, |
| 698 OneClickSigninHelper::CanOfferOnIOThreadImpl( | 728 OneClickSigninHelper::CanOfferOnIOThreadImpl( |
| 699 valid_gaia_url_, "", &request_, io_data.get())); | 729 valid_gaia_url_, "", &request_, io_data.get())); |
| 700 } | 730 } |
| OLD | NEW |