OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_PROFILE_H__ | 7 #ifndef CHROME_BROWSER_PROFILE_H__ |
8 #define CHROME_BROWSER_PROFILE_H__ | 8 #define CHROME_BROWSER_PROFILE_H__ |
9 | 9 |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/ref_counted.h" | 14 #include "base/ref_counted.h" |
15 #include "base/scoped_ptr.h" | 15 #include "base/scoped_ptr.h" |
16 #include "base/task.h" | 16 #include "base/task.h" |
17 #include "base/timer.h" | 17 #include "base/timer.h" |
18 #ifdef CHROME_PERSONALIZATION | 18 #ifdef CHROME_PERSONALIZATION |
19 #include "chrome/personalization/personalization.h" | 19 #include "chrome/personalization/personalization.h" |
20 #endif | 20 #endif |
21 #include "chrome/common/notification_service.h" | 21 #include "chrome/common/notification_service.h" |
22 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
23 #include "chrome/common/pref_service.h" | 23 #include "chrome/common/pref_service.h" |
24 | 24 |
25 class BookmarkModel; | 25 class BookmarkModel; |
26 class DownloadManager; | 26 class DownloadManager; |
| 27 class ExtensionsService; |
27 class GreasemonkeyMaster; | 28 class GreasemonkeyMaster; |
28 class HistoryService; | 29 class HistoryService; |
29 class NavigationController; | 30 class NavigationController; |
30 class PrefService; | 31 class PrefService; |
31 class SessionService; | 32 class SessionService; |
32 class SpellChecker; | 33 class SpellChecker; |
33 class TabRestoreService; | 34 class TabRestoreService; |
34 class TemplateURLFetcher; | 35 class TemplateURLFetcher; |
35 class TemplateURLModel; | 36 class TemplateURLModel; |
36 class URLRequestContext; | 37 class URLRequestContext; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 96 |
96 // Return the original "recording" profile. This method returns this if the | 97 // Return the original "recording" profile. This method returns this if the |
97 // profile is not off the record. | 98 // profile is not off the record. |
98 virtual Profile* GetOriginalProfile() = 0; | 99 virtual Profile* GetOriginalProfile() = 0; |
99 | 100 |
100 // Retrieves a pointer to the VisitedLinkMaster associated with this | 101 // Retrieves a pointer to the VisitedLinkMaster associated with this |
101 // profile. The VisitedLinkMaster is lazily created the first time | 102 // profile. The VisitedLinkMaster is lazily created the first time |
102 // that this method is called. | 103 // that this method is called. |
103 virtual VisitedLinkMaster* GetVisitedLinkMaster() = 0; | 104 virtual VisitedLinkMaster* GetVisitedLinkMaster() = 0; |
104 | 105 |
| 106 // Retrieves a pointer to the ExtensionsService associated with this |
| 107 // profile. The ExtensionsService is created at startup. |
| 108 virtual ExtensionsService* GetExtensionsService() = 0; |
| 109 |
105 // Retrieves a pointer to the GreasemonkeyMaster associated with this | 110 // Retrieves a pointer to the GreasemonkeyMaster associated with this |
106 // profile. The GreasemonkeyMaster is lazily created the first time | 111 // profile. The GreasemonkeyMaster is lazily created the first time |
107 // that this method is called. | 112 // that this method is called. |
108 virtual GreasemonkeyMaster* GetGreasemonkeyMaster() = 0; | 113 virtual GreasemonkeyMaster* GetGreasemonkeyMaster() = 0; |
109 | 114 |
110 // Retrieves a pointer to the HistoryService associated with this | 115 // Retrieves a pointer to the HistoryService associated with this |
111 // profile. The HistoryService is lazily created the first time | 116 // profile. The HistoryService is lazily created the first time |
112 // that this method is called. | 117 // that this method is called. |
113 // Although HistoryService is refcounted, this will not addref, and callers | 118 // Although HistoryService is refcounted, this will not addref, and callers |
114 // do not need to do any reference counting as long as they keep the pointer | 119 // do not need to do any reference counting as long as they keep the pointer |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 public: | 241 public: |
237 virtual ~ProfileImpl(); | 242 virtual ~ProfileImpl(); |
238 | 243 |
239 // Profile implementation. | 244 // Profile implementation. |
240 virtual std::wstring GetPath(); | 245 virtual std::wstring GetPath(); |
241 virtual bool IsOffTheRecord(); | 246 virtual bool IsOffTheRecord(); |
242 virtual Profile* GetOffTheRecordProfile(); | 247 virtual Profile* GetOffTheRecordProfile(); |
243 virtual Profile* GetOriginalProfile(); | 248 virtual Profile* GetOriginalProfile(); |
244 virtual VisitedLinkMaster* GetVisitedLinkMaster(); | 249 virtual VisitedLinkMaster* GetVisitedLinkMaster(); |
245 virtual GreasemonkeyMaster* GetGreasemonkeyMaster(); | 250 virtual GreasemonkeyMaster* GetGreasemonkeyMaster(); |
| 251 virtual ExtensionsService* GetExtensionsService(); |
246 virtual HistoryService* GetHistoryService(ServiceAccessType sat); | 252 virtual HistoryService* GetHistoryService(ServiceAccessType sat); |
247 virtual WebDataService* GetWebDataService(ServiceAccessType sat); | 253 virtual WebDataService* GetWebDataService(ServiceAccessType sat); |
248 virtual PrefService* GetPrefs(); | 254 virtual PrefService* GetPrefs(); |
249 virtual TemplateURLModel* GetTemplateURLModel(); | 255 virtual TemplateURLModel* GetTemplateURLModel(); |
250 virtual TemplateURLFetcher* GetTemplateURLFetcher(); | 256 virtual TemplateURLFetcher* GetTemplateURLFetcher(); |
251 virtual DownloadManager* GetDownloadManager(); | 257 virtual DownloadManager* GetDownloadManager(); |
252 virtual bool HasCreatedDownloadManager() const; | 258 virtual bool HasCreatedDownloadManager() const; |
253 virtual URLRequestContext* GetRequestContext(); | 259 virtual URLRequestContext* GetRequestContext(); |
254 virtual SessionService* GetSessionService(); | 260 virtual SessionService* GetSessionService(); |
255 virtual void ShutdownSessionService(); | 261 virtual void ShutdownSessionService(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 // spellchecker language can be changed without restarting the browser. | 302 // spellchecker language can be changed without restarting the browser. |
297 // NOTE: This is being currently called in the UI thread, which is OK as long | 303 // NOTE: This is being currently called in the UI thread, which is OK as long |
298 // as the spellchecker object is USED in the IO thread. | 304 // as the spellchecker object is USED in the IO thread. |
299 // The |need_to_broadcast| parameter tells it whether to broadcast the new | 305 // The |need_to_broadcast| parameter tells it whether to broadcast the new |
300 // spellchecker to the resource message filters. | 306 // spellchecker to the resource message filters. |
301 void InitializeSpellChecker(bool need_to_broadcast); | 307 void InitializeSpellChecker(bool need_to_broadcast); |
302 | 308 |
303 std::wstring path_; | 309 std::wstring path_; |
304 bool off_the_record_; | 310 bool off_the_record_; |
305 scoped_ptr<VisitedLinkMaster> visited_link_master_; | 311 scoped_ptr<VisitedLinkMaster> visited_link_master_; |
| 312 scoped_refptr<ExtensionsService> extensions_service_; |
306 scoped_refptr<GreasemonkeyMaster> greasemonkey_master_; | 313 scoped_refptr<GreasemonkeyMaster> greasemonkey_master_; |
307 scoped_ptr<PrefService> prefs_; | 314 scoped_ptr<PrefService> prefs_; |
308 scoped_ptr<TemplateURLFetcher> template_url_fetcher_; | 315 scoped_ptr<TemplateURLFetcher> template_url_fetcher_; |
309 scoped_ptr<TemplateURLModel> template_url_model_; | 316 scoped_ptr<TemplateURLModel> template_url_model_; |
310 scoped_ptr<BookmarkModel> bookmark_bar_model_; | 317 scoped_ptr<BookmarkModel> bookmark_bar_model_; |
311 | 318 |
312 #ifdef CHROME_PERSONALIZATION | 319 #ifdef CHROME_PERSONALIZATION |
313 scoped_ptr<ProfilePersonalization> personalization_; | 320 scoped_ptr<ProfilePersonalization> personalization_; |
314 #endif | 321 #endif |
315 | 322 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 354 |
348 // This struct is used to pass the spellchecker object through the notification | 355 // This struct is used to pass the spellchecker object through the notification |
349 // NOTIFY_SPELLCHECKER_REINITIALIZED. This is used as the details for the | 356 // NOTIFY_SPELLCHECKER_REINITIALIZED. This is used as the details for the |
350 // notification service. | 357 // notification service. |
351 struct SpellcheckerReinitializedDetails { | 358 struct SpellcheckerReinitializedDetails { |
352 scoped_refptr<SpellChecker> spellchecker; | 359 scoped_refptr<SpellChecker> spellchecker; |
353 }; | 360 }; |
354 | 361 |
355 #endif // CHROME_BROWSER_PROFILE_H__ | 362 #endif // CHROME_BROWSER_PROFILE_H__ |
356 | 363 |
OLD | NEW |