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

Side by Side Diff: chrome/browser/profiles/profile_impl.h

Issue 8135017: Refactor downloads into a ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to LKGR to run try bots. Created 9 years, 2 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) 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 // This class gathers state related to a single user profile. 5 // This class gathers state related to a single user profile.
6 6
7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_
8 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ 8 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_
9 #pragma once 9 #pragma once
10 10
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/timer.h" 14 #include "base/timer.h"
15 #include "chrome/browser/prefs/pref_change_registrar.h" 15 #include "chrome/browser/prefs/pref_change_registrar.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/profiles/profile_impl_io_data.h" 17 #include "chrome/browser/profiles/profile_impl_io_data.h"
18 #include "content/common/notification_observer.h" 18 #include "content/common/notification_observer.h"
19 #include "content/common/notification_registrar.h" 19 #include "content/common/notification_registrar.h"
20 20
21 class ChromeDownloadManagerDelegate;
22 class ExtensionNavigationObserver; 21 class ExtensionNavigationObserver;
23 class ExtensionPrefs; 22 class ExtensionPrefs;
24 class ExtensionPrefValueMap; 23 class ExtensionPrefValueMap;
25 class ExtensionSettings; 24 class ExtensionSettings;
26 class NetPrefObserver; 25 class NetPrefObserver;
27 class PrefService; 26 class PrefService;
28 class SpeechInputPreferences; 27 class SpeechInputPreferences;
29 class SpellCheckProfile; 28 class SpellCheckProfile;
30 29
31 #if defined(OS_CHROMEOS) 30 #if defined(OS_CHROMEOS)
32 namespace chromeos { 31 namespace chromeos {
33 class EnterpriseExtensionObserver; 32 class EnterpriseExtensionObserver;
34 class LocaleChangeGuard; 33 class LocaleChangeGuard;
35 class Preferences; 34 class Preferences;
36 } 35 }
37 #endif 36 #endif
38 37
39 // The default profile implementation. 38 // The default profile implementation.
40 class ProfileImpl : public Profile, 39 class ProfileImpl : public Profile,
41 public NotificationObserver { 40 public NotificationObserver {
42 public: 41 public:
43 virtual ~ProfileImpl(); 42 virtual ~ProfileImpl();
44 43
45 static void RegisterUserPrefs(PrefService* prefs); 44 static void RegisterUserPrefs(PrefService* prefs);
46 45
47 // content::BrowserContext implementation: 46 // content::BrowserContext implementation:
48 virtual FilePath GetPath() OVERRIDE; 47 virtual FilePath GetPath() OVERRIDE;
49 virtual SSLHostState* GetSSLHostState() OVERRIDE; 48 virtual SSLHostState* GetSSLHostState() OVERRIDE;
50 virtual DownloadManager* GetDownloadManager() OVERRIDE; 49 virtual DownloadManager* GetDownloadManager() OVERRIDE;
51 virtual bool HasCreatedDownloadManager() const OVERRIDE;
52 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; 50 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
53 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( 51 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess(
54 int renderer_child_id) OVERRIDE; 52 int renderer_child_id) OVERRIDE;
55 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE; 53 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE;
56 virtual const content::ResourceContext& GetResourceContext() OVERRIDE; 54 virtual const content::ResourceContext& GetResourceContext() OVERRIDE;
57 virtual HostZoomMap* GetHostZoomMap() OVERRIDE; 55 virtual HostZoomMap* GetHostZoomMap() OVERRIDE;
58 virtual GeolocationPermissionContext* 56 virtual GeolocationPermissionContext*
59 GetGeolocationPermissionContext() OVERRIDE; 57 GetGeolocationPermissionContext() OVERRIDE;
60 virtual SpeechInputPreferences* GetSpeechInputPreferences() OVERRIDE; 58 virtual SpeechInputPreferences* GetSpeechInputPreferences() OVERRIDE;
61 virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; 59 virtual quota::QuotaManager* GetQuotaManager() OVERRIDE;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 void EnsureSessionServiceCreated(); 176 void EnsureSessionServiceCreated();
179 177
180 void RegisterComponentExtensions(); 178 void RegisterComponentExtensions();
181 179
182 ExtensionPrefValueMap* GetExtensionPrefValueMap(); 180 ExtensionPrefValueMap* GetExtensionPrefValueMap();
183 181
184 void CreateQuotaManagerAndClients(); 182 void CreateQuotaManagerAndClients();
185 183
186 SpellCheckProfile* GetSpellCheckProfile(); 184 SpellCheckProfile* GetSpellCheckProfile();
187 185
188 virtual void SetDownloadManagerDelegate(
189 ChromeDownloadManagerDelegate* delegate);
190
191 NotificationRegistrar registrar_; 186 NotificationRegistrar registrar_;
192 PrefChangeRegistrar pref_change_registrar_; 187 PrefChangeRegistrar pref_change_registrar_;
193 188
194 FilePath path_; 189 FilePath path_;
195 FilePath base_cache_path_; 190 FilePath base_cache_path_;
196 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_; 191 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_;
197 // Keep |prefs_| on top for destruction order because |extension_prefs_|, 192 // Keep |prefs_| on top for destruction order because |extension_prefs_|,
198 // |net_pref_observer_|, |web_resource_service_|, and |io_data_| store 193 // |net_pref_observer_|, |web_resource_service_|, and |io_data_| store
199 // pointers to |prefs_| and shall be destructed first. 194 // pointers to |prefs_| and shall be destructed first.
200 scoped_ptr<PrefService> prefs_; 195 scoped_ptr<PrefService> prefs_;
(...skipping 28 matching lines...) Expand all
229 224
230 scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_; 225 scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_;
231 226
232 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; 227 scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
233 scoped_refptr<HostZoomMap> host_zoom_map_; 228 scoped_refptr<HostZoomMap> host_zoom_map_;
234 scoped_refptr<GeolocationPermissionContext> 229 scoped_refptr<GeolocationPermissionContext>
235 geolocation_permission_context_; 230 geolocation_permission_context_;
236 scoped_refptr<SpeechInputPreferences> speech_input_preferences_; 231 scoped_refptr<SpeechInputPreferences> speech_input_preferences_;
237 scoped_refptr<UserStyleSheetWatcher> user_style_sheet_watcher_; 232 scoped_refptr<UserStyleSheetWatcher> user_style_sheet_watcher_;
238 scoped_ptr<FindBarState> find_bar_state_; 233 scoped_ptr<FindBarState> find_bar_state_;
239 scoped_refptr<ChromeDownloadManagerDelegate> download_manager_delegate_;
240 scoped_refptr<DownloadManager> download_manager_;
241 scoped_refptr<HistoryService> history_service_; 234 scoped_refptr<HistoryService> history_service_;
242 scoped_ptr<FaviconService> favicon_service_; 235 scoped_ptr<FaviconService> favicon_service_;
243 scoped_ptr<AutocompleteClassifier> autocomplete_classifier_; 236 scoped_ptr<AutocompleteClassifier> autocomplete_classifier_;
244 scoped_refptr<history::ShortcutsBackend> shortcuts_backend_; 237 scoped_refptr<history::ShortcutsBackend> shortcuts_backend_;
245 scoped_refptr<WebDataService> web_data_service_; 238 scoped_refptr<WebDataService> web_data_service_;
246 scoped_refptr<PasswordStore> password_store_; 239 scoped_refptr<PasswordStore> password_store_;
247 scoped_refptr<WebKitContext> webkit_context_; 240 scoped_refptr<WebKitContext> webkit_context_;
248 scoped_refptr<fileapi::FileSystemContext> file_system_context_; 241 scoped_refptr<fileapi::FileSystemContext> file_system_context_;
249 scoped_refptr<quota::QuotaManager> quota_manager_; 242 scoped_refptr<quota::QuotaManager> quota_manager_;
250 bool history_service_created_; 243 bool history_service_created_;
251 bool favicon_service_created_; 244 bool favicon_service_created_;
252 bool created_web_data_service_; 245 bool created_web_data_service_;
253 bool created_password_store_; 246 bool created_password_store_;
254 bool created_download_manager_;
255 bool clear_local_state_on_exit_; 247 bool clear_local_state_on_exit_;
256 // Whether or not the last session exited cleanly. This is set only once. 248 // Whether or not the last session exited cleanly. This is set only once.
257 bool last_session_exited_cleanly_; 249 bool last_session_exited_cleanly_;
258 250
259 base::OneShotTimer<ProfileImpl> create_session_service_timer_; 251 base::OneShotTimer<ProfileImpl> create_session_service_timer_;
260 252
261 scoped_ptr<Profile> off_the_record_profile_; 253 scoped_ptr<Profile> off_the_record_profile_;
262 254
263 // See GetStartTime for details. 255 // See GetStartTime for details.
264 base::Time start_time_; 256 base::Time start_time_;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; 290 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_;
299 291
300 Profile::Delegate* delegate_; 292 Profile::Delegate* delegate_;
301 293
302 chrome_browser_net::Predictor* predictor_; 294 chrome_browser_net::Predictor* predictor_;
303 295
304 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); 296 DISALLOW_COPY_AND_ASSIGN(ProfileImpl);
305 }; 297 };
306 298
307 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ 299 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698