OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 // This class gathers state related to an instantiation of content. | |
jam
2011/07/21 16:41:54
nit: "instantiation of content" is a little crypti
| |
6 | |
7 #ifndef CONTENT_BROWSER_BROWSER_CONTEXT_H_ | |
8 #define CONTENT_BROWSER_BROWSER_CONTEXT_H_ | |
9 #pragma once | |
10 | |
11 #include "base/hash_tables.h" | |
12 | |
13 namespace net { | |
14 class URLRequestContextGetter; | |
15 } | |
16 | |
17 namespace quota { | |
18 class QuotaManager; | |
19 } | |
20 | |
21 namespace webkit_database { | |
22 class DatabaseTracker; | |
23 } | |
24 | |
25 class ChromeBlobStorageContext; | |
26 class DownloadManager; | |
27 class FilePath; | |
28 class GeolocationContentSettingsMap; | |
29 class GeolocationPermissionContext; | |
30 class HostZoomMap; | |
31 class SSLHostState; | |
32 class WebKitContext; | |
33 | |
34 namespace content { | |
35 | |
36 class ResourceContext; | |
37 | |
38 class BrowserContext { | |
39 public: | |
40 // Returns the path of the directory where this context's data is stored. | |
41 virtual FilePath GetPath() = 0; | |
42 | |
43 // Return whether this context is incognito. Default is false. | |
44 // This doesn't belong here; http://crbug.com/89628 | |
45 virtual bool IsOffTheRecord() = 0; | |
46 | |
47 // Returns a pointer to the DatabaseTracker instance for this profile. | |
jam
2011/07/21 16:41:54
nit: should get rid of "profile" in this file
| |
48 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0; | |
49 | |
50 // Retrieves a pointer to the SSLHostState associated with this profile. | |
51 // The SSLHostState is lazily created the first time that this method is | |
52 // called. | |
53 virtual SSLHostState* GetSSLHostState() = 0; | |
54 | |
55 // Returns the DownloadManager associated with this profile. | |
56 virtual DownloadManager* GetDownloadManager() = 0; | |
57 virtual bool HasCreatedDownloadManager() const = 0; | |
58 | |
59 virtual quota::QuotaManager* GetQuotaManager() = 0; | |
60 | |
61 // Returns the request context information associated with this profile. Call | |
62 // this only on the UI thread, since it can send notifications that should | |
63 // happen on the UI thread. | |
64 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | |
65 | |
66 // Returns the request context appropriate for the given renderer. If the | |
67 // renderer process doesn't have an associated installed app, or if the | |
68 // installed app's is_storage_isolated() returns false, this is equivalent to | |
69 // calling GetRequestContext(). | |
70 // TODO(creis): After isolated app storage is no longer an experimental | |
71 // feature, consider making this the default contract for GetRequestContext. | |
72 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | |
73 int renderer_child_id) = 0; | |
74 | |
75 // Returns the request context for media resources asociated with this | |
76 // profile. | |
77 virtual net::URLRequestContextGetter* GetRequestContextForMedia() = 0; | |
78 | |
79 // Returns the resource context. | |
80 virtual const ResourceContext& GetResourceContext() = 0; | |
81 | |
82 // Returns the Hostname <-> Zoom Level map for this profile. | |
83 virtual HostZoomMap* GetHostZoomMap() = 0; | |
84 | |
85 // Returns the geolocation settings map for this profile. | |
86 virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap() = 0; | |
87 | |
88 // Returns the geolocation permission context for this profile. | |
89 virtual GeolocationPermissionContext* GetGeolocationPermissionContext() = 0; | |
90 | |
91 // Returns true if the last time this profile was open it was exited cleanly. | |
92 // This doesn't belong here; http://crbug.com/76788 | |
93 virtual bool DidLastSessionExitCleanly() = 0; | |
94 | |
95 // Returns the WebKitContext assigned to this profile. | |
96 virtual WebKitContext* GetWebKitContext() = 0; | |
97 | |
98 // Returns a pointer to the ChromeBlobStorageContext instance for this | |
99 // profile. | |
100 virtual ChromeBlobStorageContext* GetBlobStorageContext() = 0; | |
101 }; | |
102 | |
103 } // namespace content | |
104 | |
105 #if defined(COMPILER_GCC) | |
106 namespace __gnu_cxx { | |
107 | |
108 template<> | |
109 struct hash<content::BrowserContext*> { | |
110 std::size_t operator()(content::BrowserContext* const& p) const { | |
111 return reinterpret_cast<std::size_t>(p); | |
112 } | |
113 }; | |
114 | |
115 } // namespace __gnu_cxx | |
116 #endif | |
117 | |
118 #endif // CONTENT_BROWSER_BROWSER_CONTEXT_H_ | |
OLD | NEW |