| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_TEST_TESTING_PROFILE_H_ | 5 #ifndef CHROME_TEST_TESTING_PROFILE_H_ |
| 6 #define CHROME_TEST_TESTING_PROFILE_H_ | 6 #define CHROME_TEST_TESTING_PROFILE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 // Returns a testing ContextGetter (if one has been created via | 218 // Returns a testing ContextGetter (if one has been created via |
| 219 // CreateRequestContext) or NULL. This is not done on-demand for two reasons: | 219 // CreateRequestContext) or NULL. This is not done on-demand for two reasons: |
| 220 // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because | 220 // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because |
| 221 // of the special memory management considerations for the | 221 // of the special memory management considerations for the |
| 222 // TestURLRequestContextGetter class, many tests would find themseleves | 222 // TestURLRequestContextGetter class, many tests would find themseleves |
| 223 // leaking if they called this method without the necessary IO thread. This | 223 // leaking if they called this method without the necessary IO thread. This |
| 224 // getter is currently only capable of returning a Context that helps test | 224 // getter is currently only capable of returning a Context that helps test |
| 225 // the CookieMonster. See implementation comments for more details. | 225 // the CookieMonster. See implementation comments for more details. |
| 226 virtual URLRequestContextGetter* GetRequestContext(); | 226 virtual URLRequestContextGetter* GetRequestContext(); |
| 227 virtual URLRequestContextGetter* GetRequestContext(const Extension* app); |
| 227 void CreateRequestContext(); | 228 void CreateRequestContext(); |
| 228 // Clears out the created request context (which must be done before shutting | 229 // Clears out the created request context (which must be done before shutting |
| 229 // down the IO thread to avoid leaks). | 230 // down the IO thread to avoid leaks). |
| 230 void ResetRequestContext(); | 231 void ResetRequestContext(); |
| 231 | 232 |
| 232 virtual URLRequestContextGetter* GetRequestContextForMedia() { return NULL; } | 233 virtual URLRequestContextGetter* GetRequestContextForMedia() { return NULL; } |
| 233 virtual URLRequestContextGetter* GetRequestContextForExtensions(); | 234 virtual URLRequestContextGetter* GetRequestContextForExtensions(); |
| 235 virtual URLRequestContextGetter* GetRequestContextForIsolatedApp( |
| 236 const Extension* installed_app); |
| 234 | 237 |
| 235 virtual net::SSLConfigService* GetSSLConfigService() { return NULL; } | 238 virtual net::SSLConfigService* GetSSLConfigService() { return NULL; } |
| 236 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() { return NULL; } | 239 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() { return NULL; } |
| 237 virtual FindBarState* GetFindBarState(); | 240 virtual FindBarState* GetFindBarState(); |
| 238 virtual HostContentSettingsMap* GetHostContentSettingsMap(); | 241 virtual HostContentSettingsMap* GetHostContentSettingsMap(); |
| 239 virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap(); | 242 virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap(); |
| 240 virtual GeolocationPermissionContext* GetGeolocationPermissionContext(); | 243 virtual GeolocationPermissionContext* GetGeolocationPermissionContext(); |
| 241 virtual HostZoomMap* GetHostZoomMap() { return NULL; } | 244 virtual HostZoomMap* GetHostZoomMap() { return NULL; } |
| 242 void set_session_service(SessionService* session_service); | 245 void set_session_service(SessionService* session_service); |
| 243 virtual SessionService* GetSessionService() { return session_service_.get(); } | 246 virtual SessionService* GetSessionService() { return session_service_.get(); } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 | 440 |
| 438 virtual ProfileId GetRuntimeId() { | 441 virtual ProfileId GetRuntimeId() { |
| 439 return original_profile_->GetRuntimeId(); | 442 return original_profile_->GetRuntimeId(); |
| 440 } | 443 } |
| 441 | 444 |
| 442 protected: | 445 protected: |
| 443 Profile* original_profile_; | 446 Profile* original_profile_; |
| 444 }; | 447 }; |
| 445 | 448 |
| 446 #endif // CHROME_TEST_TESTING_PROFILE_H_ | 449 #endif // CHROME_TEST_TESTING_PROFILE_H_ |
| OLD | NEW |