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" |
11 #include "base/supports_user_data.h" | 11 #include "base/supports_user_data.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/public/browser/zoom_level_prefs_delegate.h" |
13 #include "content/public/common/push_messaging_status.h" | 14 #include "content/public/common/push_messaging_status.h" |
14 | 15 |
15 class GURL; | 16 class GURL; |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class FilePath; | 19 class FilePath; |
19 } | 20 } |
20 | 21 |
21 namespace fileapi { | 22 namespace fileapi { |
22 class ExternalMountPoints; | 23 class ExternalMountPoints; |
(...skipping 77 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 // Override to provide for creation of a delegate that can be used to persist |
| 121 // data stored in a HostZoomMap. The delegate is used to initialize the |
| 122 // HostZoomMap and persist its information. This is called during creation |
| 123 // of each StoragePartition. |
| 124 virtual scoped_ptr<ZoomLevelPrefsDelegate> CreateZoomLevelPrefsDelegate(); |
| 125 |
112 // Returns the path of the directory where this context's data is stored. | 126 // Returns the path of the directory where this context's data is stored. |
113 virtual base::FilePath GetPath() const = 0; | 127 virtual base::FilePath GetPath() const = 0; |
114 | 128 |
115 // Return whether this context is incognito. Default is false. | 129 // Return whether this context is incognito. Default is false. |
116 virtual bool IsOffTheRecord() const = 0; | 130 virtual bool IsOffTheRecord() const = 0; |
117 | 131 |
118 // Returns the request context information associated with this context. Call | 132 // Returns the request context information associated with this context. Call |
119 // this only on the UI thread, since it can send notifications that should | 133 // this only on the UI thread, since it can send notifications that should |
120 // happen on the UI thread. | 134 // happen on the UI thread. |
121 // TODO(creis): Remove this version in favor of the one below. | 135 // 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*> { | 189 struct hash<content::BrowserContext*> { |
176 std::size_t operator()(content::BrowserContext* const& p) const { | 190 std::size_t operator()(content::BrowserContext* const& p) const { |
177 return reinterpret_cast<std::size_t>(p); | 191 return reinterpret_cast<std::size_t>(p); |
178 } | 192 } |
179 }; | 193 }; |
180 | 194 |
181 } // namespace BASE_HASH_NAMESPACE | 195 } // namespace BASE_HASH_NAMESPACE |
182 #endif | 196 #endif |
183 | 197 |
184 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 198 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
OLD | NEW |