OLD | NEW |
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 // 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_H_ | 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_H_ |
8 #define CHROME_BROWSER_PROFILES_PROFILE_H_ | 8 #define CHROME_BROWSER_PROFILES_PROFILE_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/hash_tables.h" | 14 #include "base/hash_tables.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "chrome/browser/net/preconnect.h" // TODO: remove this. | 16 #include "chrome/browser/net/preconnect.h" // TODO: remove this. |
17 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 17 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
18 #include "chrome/common/extensions/extension_constants.h" | |
19 #include "content/public/browser/browser_context.h" | 18 #include "content/public/browser/browser_context.h" |
20 | 19 |
21 class AutocompleteClassifier; | 20 class AutocompleteClassifier; |
22 class BookmarkModel; | 21 class BookmarkModel; |
23 class ChromeAppCacheService; | 22 class ChromeAppCacheService; |
24 class ChromeURLDataManager; | 23 class ChromeURLDataManager; |
25 class Extension; | 24 class Extension; |
26 class ExtensionDevToolsManager; | |
27 class ExtensionEventRouter; | 25 class ExtensionEventRouter; |
28 class ExtensionInfoMap; | |
29 class ExtensionMessageService; | |
30 class ExtensionProcessManager; | 26 class ExtensionProcessManager; |
31 class ExtensionService; | 27 class ExtensionService; |
32 class ExtensionSpecialStoragePolicy; | 28 class ExtensionSpecialStoragePolicy; |
33 class FaviconService; | 29 class FaviconService; |
34 class GAIAInfoUpdateService; | 30 class GAIAInfoUpdateService; |
35 class HistoryService; | 31 class HistoryService; |
36 class HostContentSettingsMap; | 32 class HostContentSettingsMap; |
37 class PasswordStore; | 33 class PasswordStore; |
38 class PrefService; | 34 class PrefService; |
39 class PromoCounter; | 35 class PromoCounter; |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 // Variant of GetTopSites that doesn't force creation. | 236 // Variant of GetTopSites that doesn't force creation. |
241 virtual history::TopSites* GetTopSitesWithoutCreating() = 0; | 237 virtual history::TopSites* GetTopSitesWithoutCreating() = 0; |
242 | 238 |
243 // Retrieves a pointer to the VisitedLinkMaster associated with this | 239 // Retrieves a pointer to the VisitedLinkMaster associated with this |
244 // profile. The VisitedLinkMaster is lazily created the first time | 240 // profile. The VisitedLinkMaster is lazily created the first time |
245 // that this method is called. | 241 // that this method is called. |
246 virtual VisitedLinkMaster* GetVisitedLinkMaster() = 0; | 242 virtual VisitedLinkMaster* GetVisitedLinkMaster() = 0; |
247 | 243 |
248 // Retrieves a pointer to the ExtensionService associated with this | 244 // Retrieves a pointer to the ExtensionService associated with this |
249 // profile. The ExtensionService is created at startup. | 245 // profile. The ExtensionService is created at startup. |
| 246 // TODO(yoz): remove this accessor (bug 104095) |
250 virtual ExtensionService* GetExtensionService() = 0; | 247 virtual ExtensionService* GetExtensionService() = 0; |
251 | 248 |
252 // Retrieves a pointer to the UserScriptMaster associated with this | 249 // Retrieves a pointer to the UserScriptMaster associated with this |
253 // profile. The UserScriptMaster is lazily created the first time | 250 // profile. The UserScriptMaster is lazily created the first time |
254 // that this method is called. | 251 // that this method is called. |
| 252 // TODO(yoz): remove this accessor (bug 104095) |
255 virtual UserScriptMaster* GetUserScriptMaster() = 0; | 253 virtual UserScriptMaster* GetUserScriptMaster() = 0; |
256 | 254 |
257 // Retrieves a pointer to the ExtensionDevToolsManager associated with this | |
258 // profile. The instance is created at startup. | |
259 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() = 0; | |
260 | |
261 // Retrieves a pointer to the ExtensionProcessManager associated with this | 255 // Retrieves a pointer to the ExtensionProcessManager associated with this |
262 // profile. The instance is created at startup. | 256 // profile. The instance is created at startup. |
| 257 // TODO(yoz): remove this accessor (bug 104095) |
263 virtual ExtensionProcessManager* GetExtensionProcessManager() = 0; | 258 virtual ExtensionProcessManager* GetExtensionProcessManager() = 0; |
264 | 259 |
265 // Retrieves a pointer to the ExtensionMessageService associated with this | |
266 // profile. The instance is created at startup. | |
267 virtual ExtensionMessageService* GetExtensionMessageService() = 0; | |
268 | |
269 // Accessor. The instance is created at startup. | 260 // Accessor. The instance is created at startup. |
| 261 // TODO(yoz): remove this accessor (bug 104095) |
270 virtual ExtensionEventRouter* GetExtensionEventRouter() = 0; | 262 virtual ExtensionEventRouter* GetExtensionEventRouter() = 0; |
271 | 263 |
272 // Accessor. The instance is created upon first access. | 264 // Accessor. The instance is created upon first access. |
273 virtual ExtensionSpecialStoragePolicy* | 265 virtual ExtensionSpecialStoragePolicy* |
274 GetExtensionSpecialStoragePolicy() = 0; | 266 GetExtensionSpecialStoragePolicy() = 0; |
275 | 267 |
276 // Retrieves a pointer to the FaviconService associated with this | 268 // Retrieves a pointer to the FaviconService associated with this |
277 // profile. The FaviconService is lazily created the first time | 269 // profile. The FaviconService is lazily created the first time |
278 // that this method is called. | 270 // that this method is called. |
279 // | 271 // |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 341 |
350 // Returns the request context used for extension-related requests. This | 342 // Returns the request context used for extension-related requests. This |
351 // is only used for a separate cookie store currently. | 343 // is only used for a separate cookie store currently. |
352 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; | 344 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; |
353 | 345 |
354 // Returns the request context used within an installed app that has | 346 // Returns the request context used within an installed app that has |
355 // requested isolated storage. | 347 // requested isolated storage. |
356 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( | 348 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( |
357 const std::string& app_id) = 0; | 349 const std::string& app_id) = 0; |
358 | 350 |
359 // Called by the ExtensionService that lives in this profile. Gives the | |
360 // profile a chance to react to the load event before the EXTENSION_LOADED | |
361 // notification has fired. The purpose for handling this event first is to | |
362 // avoid race conditions by making sure URLRequestContexts learn about new | |
363 // extensions before anything else needs them to know. | |
364 virtual void RegisterExtensionWithRequestContexts( | |
365 const Extension* extension) {} | |
366 | |
367 // Called by the ExtensionService that lives in this profile. Lets the | |
368 // profile clean up its RequestContexts once all the listeners to the | |
369 // EXTENSION_UNLOADED notification have finished running. | |
370 virtual void UnregisterExtensionWithRequestContexts( | |
371 const std::string& extension_id, | |
372 const extension_misc::UnloadedExtensionReason) {} | |
373 | |
374 // Returns the SSLConfigService for this profile. | 351 // Returns the SSLConfigService for this profile. |
375 virtual net::SSLConfigService* GetSSLConfigService() = 0; | 352 virtual net::SSLConfigService* GetSSLConfigService() = 0; |
376 | 353 |
377 // Returns the Hostname <-> Content settings map for this profile. | 354 // Returns the Hostname <-> Content settings map for this profile. |
378 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; | 355 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; |
379 | 356 |
380 // Returns the user style sheet watcher. | 357 // Returns the user style sheet watcher. |
381 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() = 0; | 358 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() = 0; |
382 | 359 |
383 // Returns true if the last time this profile was open it was exited cleanly. | 360 // Returns true if the last time this profile was open it was exited cleanly. |
(...skipping 19 matching lines...) Expand all Loading... |
403 // this profile. For the single profile case, this corresponds to the time | 380 // this profile. For the single profile case, this corresponds to the time |
404 // the user started chrome. | 381 // the user started chrome. |
405 virtual base::Time GetStartTime() const = 0; | 382 virtual base::Time GetStartTime() const = 0; |
406 | 383 |
407 // Marks the profile as cleanly shutdown. | 384 // Marks the profile as cleanly shutdown. |
408 // | 385 // |
409 // NOTE: this is invoked internally on a normal shutdown, but is public so | 386 // NOTE: this is invoked internally on a normal shutdown, but is public so |
410 // that it can be invoked when the user logs out/powers down (WM_ENDSESSION). | 387 // that it can be invoked when the user logs out/powers down (WM_ENDSESSION). |
411 virtual void MarkAsCleanShutdown() = 0; | 388 virtual void MarkAsCleanShutdown() = 0; |
412 | 389 |
413 // Initializes extensions machinery. | |
414 // Component extensions are always enabled, external and user extensions | |
415 // are controlled by |extensions_enabled|. | |
416 virtual void InitExtensions(bool extensions_enabled) = 0; | |
417 | |
418 // Start up service that gathers data from a promo resource feed. | 390 // Start up service that gathers data from a promo resource feed. |
419 virtual void InitPromoResources() = 0; | 391 virtual void InitPromoResources() = 0; |
420 | 392 |
421 // Register URLRequestFactories for protocols registered with | 393 // Register URLRequestFactories for protocols registered with |
422 // registerProtocolHandler. | 394 // registerProtocolHandler. |
423 virtual void InitRegisteredProtocolHandlers() = 0; | 395 virtual void InitRegisteredProtocolHandlers() = 0; |
424 | 396 |
425 // Returns the last directory that was chosen for uploading or opening a file. | 397 // Returns the last directory that was chosen for uploading or opening a file. |
426 virtual FilePath last_selected_directory() = 0; | 398 virtual FilePath last_selected_directory() = 0; |
427 virtual void set_last_selected_directory(const FilePath& path) = 0; | 399 virtual void set_last_selected_directory(const FilePath& path) = 0; |
428 | 400 |
429 // Returns the IO-thread-accessible profile data for this profile. | |
430 virtual ExtensionInfoMap* GetExtensionInfoMap() = 0; | |
431 | |
432 // Returns the PromoCounter for Instant, or NULL if not applicable. | 401 // Returns the PromoCounter for Instant, or NULL if not applicable. |
433 virtual PromoCounter* GetInstantPromoCounter() = 0; | 402 virtual PromoCounter* GetInstantPromoCounter() = 0; |
434 | 403 |
435 // Returns the ChromeURLDataManager for this profile. | 404 // Returns the ChromeURLDataManager for this profile. |
436 virtual ChromeURLDataManager* GetChromeURLDataManager() = 0; | 405 virtual ChromeURLDataManager* GetChromeURLDataManager() = 0; |
437 | 406 |
438 #if defined(OS_CHROMEOS) | 407 #if defined(OS_CHROMEOS) |
439 enum AppLocaleChangedVia { | 408 enum AppLocaleChangedVia { |
440 // Caused by chrome://settings change. | 409 // Caused by chrome://settings change. |
441 APP_LOCALE_CHANGED_VIA_SETTINGS, | 410 APP_LOCALE_CHANGED_VIA_SETTINGS, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 struct hash<Profile*> { | 523 struct hash<Profile*> { |
555 std::size_t operator()(Profile* const& p) const { | 524 std::size_t operator()(Profile* const& p) const { |
556 return reinterpret_cast<std::size_t>(p); | 525 return reinterpret_cast<std::size_t>(p); |
557 } | 526 } |
558 }; | 527 }; |
559 | 528 |
560 } // namespace BASE_HASH_NAMESPACE | 529 } // namespace BASE_HASH_NAMESPACE |
561 #endif | 530 #endif |
562 | 531 |
563 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 532 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
OLD | NEW |