Chromium Code Reviews| 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 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 class BlobHandle; | 35 class BlobHandle; |
| 36 class BrowserPluginGuestManager; | 36 class BrowserPluginGuestManager; |
| 37 class DownloadManager; | 37 class DownloadManager; |
| 38 class DownloadManagerDelegate; | 38 class DownloadManagerDelegate; |
| 39 class IndexedDBContext; | 39 class IndexedDBContext; |
| 40 class PushMessagingService; | 40 class PushMessagingService; |
| 41 class ResourceContext; | 41 class ResourceContext; |
| 42 class SiteInstance; | 42 class SiteInstance; |
| 43 class StoragePartition; | 43 class StoragePartition; |
| 44 class SSLHostStateDelegate; | 44 class SSLHostStateDelegate; |
| 45 class ZoomLevelPrefsDelegate; | |
| 45 | 46 |
| 46 // This class holds the context needed for a browsing session. | 47 // This class holds the context needed for a browsing session. |
| 47 // It lives on the UI thread. All these methods must only be called on the UI | 48 // It lives on the UI thread. All these methods must only be called on the UI |
| 48 // thread. | 49 // thread. |
| 49 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { | 50 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { |
| 50 public: | 51 public: |
| 51 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); | 52 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); |
| 52 | 53 |
| 53 // Returns BrowserContext specific external mount points. It may return NULL | 54 // Returns BrowserContext specific external mount points. It may return NULL |
| 54 // if the context doesn't have any BrowserContext specific external mount | 55 // if the context doesn't have any BrowserContext specific external mount |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 // BrowserContext initializs the corresponding getters when its objects are | 101 // BrowserContext initializs the corresponding getters when its objects are |
| 101 // created, but if the embedder wants to pass the ResourceContext to another | 102 // created, but if the embedder wants to pass the ResourceContext to another |
| 102 // thread before they use BrowserContext, they should call this to make sure | 103 // thread before they use BrowserContext, they should call this to make sure |
| 103 // that the ResourceContext is ready. | 104 // that the ResourceContext is ready. |
| 104 static void EnsureResourceContextInitialized(BrowserContext* browser_context); | 105 static void EnsureResourceContextInitialized(BrowserContext* browser_context); |
| 105 | 106 |
| 106 // Tells the HTML5 objects on this context to persist their session state | 107 // Tells the HTML5 objects on this context to persist their session state |
| 107 // across the next restart. | 108 // across the next restart. |
| 108 static void SaveSessionState(BrowserContext* browser_context); | 109 static void SaveSessionState(BrowserContext* browser_context); |
| 109 | 110 |
| 111 // Changes the default zoom level for all current storage partitions. | |
| 112 static void SetDefaultZoomLevel(BrowserContext* browser_context, | |
| 113 double level); | |
| 114 | |
| 110 virtual ~BrowserContext(); | 115 virtual ~BrowserContext(); |
| 111 | 116 |
| 117 // Returns the default zoom level. | |
| 118 virtual double GetDefaultZoomLevel() const; | |
| 119 | |
| 120 // Returns a delegate used to persist zoom level preference, or NULL if | |
| 121 // zoom levels are not persisted. The caller takes ownership of the delegate. | |
|
awong
2014/08/12 21:07:06
This comment doesn't give me enough info to unders
wjmaclean
2014/08/13 17:16:03
Done.
| |
| 122 virtual ZoomLevelPrefsDelegate* CreateZoomLevelPrefsDelegate(); | |
| 123 | |
| 112 // Returns the path of the directory where this context's data is stored. | 124 // Returns the path of the directory where this context's data is stored. |
| 113 virtual base::FilePath GetPath() const = 0; | 125 virtual base::FilePath GetPath() const = 0; |
| 114 | 126 |
| 115 // Return whether this context is incognito. Default is false. | 127 // Return whether this context is incognito. Default is false. |
| 116 virtual bool IsOffTheRecord() const = 0; | 128 virtual bool IsOffTheRecord() const = 0; |
| 117 | 129 |
| 118 // Returns the request context information associated with this context. Call | 130 // Returns the request context information associated with this context. Call |
| 119 // this only on the UI thread, since it can send notifications that should | 131 // this only on the UI thread, since it can send notifications that should |
| 120 // happen on the UI thread. | 132 // happen on the UI thread. |
| 121 // TODO(creis): Remove this version in favor of the one below. | 133 // TODO(creis): Remove this version in favor of the one below. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 175 struct hash<content::BrowserContext*> { | 187 struct hash<content::BrowserContext*> { |
| 176 std::size_t operator()(content::BrowserContext* const& p) const { | 188 std::size_t operator()(content::BrowserContext* const& p) const { |
| 177 return reinterpret_cast<std::size_t>(p); | 189 return reinterpret_cast<std::size_t>(p); |
| 178 } | 190 } |
| 179 }; | 191 }; |
| 180 | 192 |
| 181 } // namespace BASE_HASH_NAMESPACE | 193 } // namespace BASE_HASH_NAMESPACE |
| 182 #endif | 194 #endif |
| 183 | 195 |
| 184 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 196 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| OLD | NEW |