Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/test/base/testing_profile.h

Issue 9369013: Take extensions out of Profile into a profile-keyed service, ExtensionSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_TEST_BASE_TESTING_PROFILE_H_ 5 #ifndef CHROME_TEST_BASE_TESTING_PROFILE_H_
6 #define CHROME_TEST_BASE_TESTING_PROFILE_H_ 6 #define CHROME_TEST_BASE_TESTING_PROFILE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // TemplateURLFetcher is NULL. 126 // TemplateURLFetcher is NULL.
127 void CreateTemplateURLFetcher(); 127 void CreateTemplateURLFetcher();
128 128
129 // Creates a TemplateURLService. If not invoked, the TemplateURLService is 129 // Creates a TemplateURLService. If not invoked, the TemplateURLService is
130 // NULL. 130 // NULL.
131 void CreateTemplateURLService(); 131 void CreateTemplateURLService();
132 132
133 // Blocks until TempalteURLService finishes loading. 133 // Blocks until TempalteURLService finishes loading.
134 void BlockUntilTemplateURLServiceLoaded(); 134 void BlockUntilTemplateURLServiceLoaded();
135 135
136 // Creates an ExtensionProcessManager. If not invoked, the
137 // ExtensionProcessManager is NULL.
138 void CreateExtensionProcessManager();
139
140 // Creates an ExtensionService initialized with the testing profile and
141 // returns it. The profile keeps its own copy of a scoped_refptr to the
142 // ExtensionService to make sure that is still alive to be notified when the
143 // profile is destroyed.
144 ExtensionService* CreateExtensionService(const CommandLine* command_line,
145 const FilePath& install_directory,
146 bool autoupdate_enabled);
147
148 TestingPrefService* GetTestingPrefService(); 136 TestingPrefService* GetTestingPrefService();
149 137
150 virtual TestingProfile* AsTestingProfile() OVERRIDE; 138 virtual TestingProfile* AsTestingProfile() OVERRIDE;
151 virtual std::string GetProfileName() OVERRIDE; 139 virtual std::string GetProfileName() OVERRIDE;
152 virtual FilePath GetPath() OVERRIDE; 140 virtual FilePath GetPath() OVERRIDE;
153 void set_incognito(bool incognito) { incognito_ = incognito; } 141 void set_incognito(bool incognito) { incognito_ = incognito; }
154 virtual bool IsOffTheRecord() OVERRIDE; 142 virtual bool IsOffTheRecord() OVERRIDE;
155 // Assumes ownership. 143 // Assumes ownership.
156 virtual void SetOffTheRecordProfile(Profile* profile); 144 virtual void SetOffTheRecordProfile(Profile* profile);
157 virtual Profile* GetOffTheRecordProfile() OVERRIDE; 145 virtual Profile* GetOffTheRecordProfile() OVERRIDE;
158 virtual void DestroyOffTheRecordProfile() OVERRIDE {} 146 virtual void DestroyOffTheRecordProfile() OVERRIDE {}
159 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE; 147 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE;
160 virtual bool HasOffTheRecordProfile() OVERRIDE; 148 virtual bool HasOffTheRecordProfile() OVERRIDE;
161 virtual Profile* GetOriginalProfile() OVERRIDE; 149 virtual Profile* GetOriginalProfile() OVERRIDE;
162 void SetAppCacheService(ChromeAppCacheService* appcache_service); 150 void SetAppCacheService(ChromeAppCacheService* appcache_service);
163 virtual ChromeAppCacheService* GetAppCacheService() OVERRIDE; 151 virtual ChromeAppCacheService* GetAppCacheService() OVERRIDE;
164 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE; 152 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE;
165 virtual VisitedLinkMaster* GetVisitedLinkMaster() OVERRIDE; 153 virtual VisitedLinkMaster* GetVisitedLinkMaster() OVERRIDE;
166 virtual ExtensionService* GetExtensionService() OVERRIDE; 154 virtual ExtensionService* GetExtensionService() OVERRIDE;
167 virtual UserScriptMaster* GetUserScriptMaster() OVERRIDE; 155 virtual UserScriptMaster* GetUserScriptMaster() OVERRIDE;
168 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() OVERRIDE;
169 virtual ExtensionProcessManager* GetExtensionProcessManager() OVERRIDE; 156 virtual ExtensionProcessManager* GetExtensionProcessManager() OVERRIDE;
170 virtual ExtensionMessageService* GetExtensionMessageService() OVERRIDE;
171 virtual ExtensionEventRouter* GetExtensionEventRouter() OVERRIDE; 157 virtual ExtensionEventRouter* GetExtensionEventRouter() OVERRIDE;
172 void SetExtensionSpecialStoragePolicy( 158 void SetExtensionSpecialStoragePolicy(
173 ExtensionSpecialStoragePolicy* extension_special_storage_policy); 159 ExtensionSpecialStoragePolicy* extension_special_storage_policy);
174 virtual ExtensionSpecialStoragePolicy* 160 virtual ExtensionSpecialStoragePolicy*
175 GetExtensionSpecialStoragePolicy() OVERRIDE; 161 GetExtensionSpecialStoragePolicy() OVERRIDE;
176 virtual SSLHostState* GetSSLHostState() OVERRIDE; 162 virtual SSLHostState* GetSSLHostState() OVERRIDE;
177 virtual FaviconService* GetFaviconService(ServiceAccessType access) OVERRIDE; 163 virtual FaviconService* GetFaviconService(ServiceAccessType access) OVERRIDE;
178 virtual HistoryService* GetHistoryService(ServiceAccessType access) OVERRIDE; 164 virtual HistoryService* GetHistoryService(ServiceAccessType access) OVERRIDE;
179 virtual HistoryService* GetHistoryServiceWithoutCreating() OVERRIDE; 165 virtual HistoryService* GetHistoryServiceWithoutCreating() OVERRIDE;
180 // The CookieMonster will only be returned if a Context has been created. Do 166 // The CookieMonster will only be returned if a Context has been created. Do
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 std::wstring* output_string) {} 229 std::wstring* output_string) {}
244 virtual void MergeResourceInteger(int message_id, int* output_value) {} 230 virtual void MergeResourceInteger(int message_id, int* output_value) {}
245 virtual void MergeResourceBoolean(int message_id, bool* output_value) {} 231 virtual void MergeResourceBoolean(int message_id, bool* output_value) {}
246 virtual BookmarkModel* GetBookmarkModel() OVERRIDE; 232 virtual BookmarkModel* GetBookmarkModel() OVERRIDE;
247 virtual bool IsSameProfile(Profile *p) OVERRIDE; 233 virtual bool IsSameProfile(Profile *p) OVERRIDE;
248 virtual base::Time GetStartTime() const OVERRIDE; 234 virtual base::Time GetStartTime() const OVERRIDE;
249 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE; 235 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE;
250 virtual WebKitContext* GetWebKitContext() OVERRIDE; 236 virtual WebKitContext* GetWebKitContext() OVERRIDE;
251 virtual WebKitContext* GetOffTheRecordWebKitContext(); 237 virtual WebKitContext* GetOffTheRecordWebKitContext();
252 virtual void MarkAsCleanShutdown() OVERRIDE {} 238 virtual void MarkAsCleanShutdown() OVERRIDE {}
253 virtual void InitExtensions(bool extensions_enabled) OVERRIDE {}
254 virtual void InitPromoResources() OVERRIDE {} 239 virtual void InitPromoResources() OVERRIDE {}
255 virtual void InitRegisteredProtocolHandlers() OVERRIDE {} 240 virtual void InitRegisteredProtocolHandlers() OVERRIDE {}
256 241
257 virtual FilePath last_selected_directory() OVERRIDE; 242 virtual FilePath last_selected_directory() OVERRIDE;
258 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE; 243 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE;
259 #if defined(OS_CHROMEOS) 244 #if defined(OS_CHROMEOS)
260 virtual void SetupChromeOSEnterpriseExtensionObserver() OVERRIDE { 245 virtual void SetupChromeOSEnterpriseExtensionObserver() OVERRIDE {
261 } 246 }
262 virtual void InitChromeOSPreferences() OVERRIDE { 247 virtual void InitChromeOSPreferences() OVERRIDE {
263 } 248 }
264 virtual void ChangeAppLocale(const std::string&, 249 virtual void ChangeAppLocale(const std::string&,
265 AppLocaleChangedVia) OVERRIDE { 250 AppLocaleChangedVia) OVERRIDE {
266 } 251 }
267 virtual void OnLogin() OVERRIDE { 252 virtual void OnLogin() OVERRIDE {
268 } 253 }
269 #endif // defined(OS_CHROMEOS) 254 #endif // defined(OS_CHROMEOS)
270 255
271 virtual PrefProxyConfigTracker* GetProxyConfigTracker() OVERRIDE; 256 virtual PrefProxyConfigTracker* GetProxyConfigTracker() OVERRIDE;
272 257
273 // Schedules a task on the history backend and runs a nested loop until the 258 // Schedules a task on the history backend and runs a nested loop until the
274 // task is processed. This has the effect of blocking the caller until the 259 // task is processed. This has the effect of blocking the caller until the
275 // history service processes all pending requests. 260 // history service processes all pending requests.
276 void BlockUntilHistoryProcessesPendingRequests(); 261 void BlockUntilHistoryProcessesPendingRequests();
277 262
278 virtual TokenService* GetTokenService() OVERRIDE; 263 virtual TokenService* GetTokenService() OVERRIDE;
279 virtual ChromeBlobStorageContext* GetBlobStorageContext() OVERRIDE; 264 virtual ChromeBlobStorageContext* GetBlobStorageContext() OVERRIDE;
280 virtual ExtensionInfoMap* GetExtensionInfoMap() OVERRIDE;
281 virtual PromoCounter* GetInstantPromoCounter() OVERRIDE; 265 virtual PromoCounter* GetInstantPromoCounter() OVERRIDE;
282 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE; 266 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE;
283 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; 267 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE;
284 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE; 268 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE;
285 virtual GURL GetHomePage() OVERRIDE; 269 virtual GURL GetHomePage() OVERRIDE;
286 270
287 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; 271 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE;
288 272
289 // TODO(jam): remove me once webkit_context_unittest.cc doesn't use Profile 273 // TODO(jam): remove me once webkit_context_unittest.cc doesn't use Profile
290 // and gets the quota::SpecialStoragePolicy* from whatever ends up replacing 274 // and gets the quota::SpecialStoragePolicy* from whatever ends up replacing
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 353
370 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; 354 scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
371 scoped_refptr<content::GeolocationPermissionContext> 355 scoped_refptr<content::GeolocationPermissionContext>
372 geolocation_permission_context_; 356 geolocation_permission_context_;
373 357
374 scoped_refptr<SpeechInputPreferences> speech_input_preferences_; 358 scoped_refptr<SpeechInputPreferences> speech_input_preferences_;
375 359
376 FilePath last_selected_directory_; 360 FilePath last_selected_directory_;
377 scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails. 361 scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails.
378 362
379 // The Extension Preferences. Only created if CreateExtensionService is
380 // invoked.
381 scoped_ptr<ExtensionPrefs> extension_prefs_;
382
383 scoped_ptr<ExtensionService> extension_service_;
384
385 scoped_ptr<ExtensionProcessManager> extension_process_manager_;
386
387 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_;
388
389 scoped_refptr<ExtensionSpecialStoragePolicy> 363 scoped_refptr<ExtensionSpecialStoragePolicy>
390 extension_special_storage_policy_; 364 extension_special_storage_policy_;
391 365
392 // The proxy prefs tracker. 366 // The proxy prefs tracker.
393 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; 367 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
394 368
395 // We use a temporary directory to store testing profile data. In a multi- 369 // We use a temporary directory to store testing profile data. In a multi-
396 // profile environment, this is invalid and the directory is managed by the 370 // profile environment, this is invalid and the directory is managed by the
397 // TestingProfileManager. 371 // TestingProfileManager.
398 ScopedTempDir temp_dir_; 372 ScopedTempDir temp_dir_;
(...skipping 11 matching lines...) Expand all
410 scoped_refptr<ChromeAppCacheService> appcache_service_; 384 scoped_refptr<ChromeAppCacheService> appcache_service_;
411 385
412 // The QuotaManager, only available if set explicitly via SetQuotaManager. 386 // The QuotaManager, only available if set explicitly via SetQuotaManager.
413 scoped_refptr<quota::QuotaManager> quota_manager_; 387 scoped_refptr<quota::QuotaManager> quota_manager_;
414 388
415 // Weak pointer to a delegate for indicating that a profile was created. 389 // Weak pointer to a delegate for indicating that a profile was created.
416 Delegate* delegate_; 390 Delegate* delegate_;
417 }; 391 };
418 392
419 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ 393 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698