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

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

Issue 6766004: Create a ProfileDependencyManager to order ProfileKeyedService destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix improper usage of static_cast<> in existing mac code. Created 9 years, 8 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
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/testing_profile.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 17 matching lines...) Expand all
28 class ExtensionPrefStore; 28 class ExtensionPrefStore;
29 class ExtensionPrefValueMap; 29 class ExtensionPrefValueMap;
30 class ExtensionSpecialStoragePolicy; 30 class ExtensionSpecialStoragePolicy;
31 class FaviconService; 31 class FaviconService;
32 class FindBarState; 32 class FindBarState;
33 class GeolocationContentSettingsMap; 33 class GeolocationContentSettingsMap;
34 class GeolocationPermissionContext; 34 class GeolocationPermissionContext;
35 class HistoryService; 35 class HistoryService;
36 class HostContentSettingsMap; 36 class HostContentSettingsMap;
37 class PrefService; 37 class PrefService;
38 class ProfileDependencyManager;
38 class ProfileSyncService; 39 class ProfileSyncService;
39 class SessionService; 40 class SessionService;
40 class TemplateURLModel; 41 class TemplateURLModel;
41 class TestingPrefService; 42 class TestingPrefService;
42 class ThemeService;
43 class URLRequestContextGetter; 43 class URLRequestContextGetter;
44 class WebKitContext; 44 class WebKitContext;
45 45
46 class TestingProfile : public Profile { 46 class TestingProfile : public Profile {
47 public: 47 public:
48 TestingProfile(); 48 TestingProfile();
49 49
50 virtual ~TestingProfile(); 50 virtual ~TestingProfile();
51 51
52 // Creates the favicon service. Consequent calls would recreate the service. 52 // Creates the favicon service. Consequent calls would recreate the service.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 // Creates an ExtensionService initialized with the testing profile and 116 // Creates an ExtensionService initialized with the testing profile and
117 // returns it. The profile keeps its own copy of a scoped_refptr to the 117 // returns it. The profile keeps its own copy of a scoped_refptr to the
118 // ExtensionService to make sure that is still alive to be notified when the 118 // ExtensionService to make sure that is still alive to be notified when the
119 // profile is destroyed. 119 // profile is destroyed.
120 ExtensionService* CreateExtensionService(const CommandLine* command_line, 120 ExtensionService* CreateExtensionService(const CommandLine* command_line,
121 const FilePath& install_directory); 121 const FilePath& install_directory);
122 122
123 TestingPrefService* GetTestingPrefService(); 123 TestingPrefService* GetTestingPrefService();
124 124
125 void SetProfileDependencyManager(ProfileDependencyManager* manager);
126
125 virtual ProfileId GetRuntimeId(); 127 virtual ProfileId GetRuntimeId();
126 128
127 virtual FilePath GetPath(); 129 virtual FilePath GetPath();
128 130
129 // Sets whether we're incognito. Default is false. 131 // Sets whether we're incognito. Default is false.
130 void set_incognito(bool incognito) { 132 void set_incognito(bool incognito) {
131 incognito_ = incognito; 133 incognito_ = incognito;
132 } 134 }
133 virtual bool IsOffTheRecord(); 135 virtual bool IsOffTheRecord();
134 // Assumes ownership. 136 // Assumes ownership.
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 381
380 // The proxy prefs tracker. 382 // The proxy prefs tracker.
381 scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; 383 scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
382 384
383 // We use a temporary directory to store testing profile data. 385 // We use a temporary directory to store testing profile data.
384 ScopedTempDir temp_dir_; 386 ScopedTempDir temp_dir_;
385 387
386 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; 388 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_;
387 389
388 scoped_refptr<prerender::PrerenderManager> prerender_manager_; 390 scoped_refptr<prerender::PrerenderManager> prerender_manager_;
391
392 // We keep a weak pointer to the dependency manager we want to notify on our
393 // death. Defaults to the Singleton implementation but overridable for
394 // testing.
395 ProfileDependencyManager* profile_dependency_manager_;
389 }; 396 };
390 397
391 // A profile that derives from another profile. This does not actually 398 // A profile that derives from another profile. This does not actually
392 // override anything except the GetRuntimeId() in order to test sharing of 399 // override anything except the GetRuntimeId() in order to test sharing of
393 // site information. 400 // site information.
394 class DerivedTestingProfile : public TestingProfile { 401 class DerivedTestingProfile : public TestingProfile {
395 public: 402 public:
396 explicit DerivedTestingProfile(Profile* profile); 403 explicit DerivedTestingProfile(Profile* profile);
397 virtual ~DerivedTestingProfile(); 404 virtual ~DerivedTestingProfile();
398 405
399 virtual ProfileId GetRuntimeId(); 406 virtual ProfileId GetRuntimeId();
400 407
401 protected: 408 protected:
402 Profile* original_profile_; 409 Profile* original_profile_;
403 }; 410 };
404 411
405 #endif // CHROME_TEST_TESTING_PROFILE_H_ 412 #endif // CHROME_TEST_TESTING_PROFILE_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/testing_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698