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/hash_tables.h" | 9 #include "base/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 "ui/base/clipboard/clipboard.h" |
13 | 14 |
14 class GURL; | 15 class GURL; |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class FilePath; | 18 class FilePath; |
18 } | 19 } |
19 | 20 |
20 namespace fileapi { | 21 namespace fileapi { |
21 class ExternalMountPoints; | 22 class ExternalMountPoints; |
22 } | 23 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // that the ResourceContext is ready. | 88 // that the ResourceContext is ready. |
88 static void EnsureResourceContextInitialized(BrowserContext* browser_context); | 89 static void EnsureResourceContextInitialized(BrowserContext* browser_context); |
89 | 90 |
90 // Tells the HTML5 objects on this context to persist their session state | 91 // Tells the HTML5 objects on this context to persist their session state |
91 // across the next restart. | 92 // across the next restart. |
92 static void SaveSessionState(BrowserContext* browser_context); | 93 static void SaveSessionState(BrowserContext* browser_context); |
93 | 94 |
94 // Tells the HTML5 objects on this context to purge any uneeded memory. | 95 // Tells the HTML5 objects on this context to purge any uneeded memory. |
95 static void PurgeMemory(BrowserContext* browser_context); | 96 static void PurgeMemory(BrowserContext* browser_context); |
96 | 97 |
| 98 // Returns a Clipboard::SourceTag (pointer) if |context| is OffTheRecord |
| 99 // context. Otherwise, NULL. If the clipboard contains that SourceTag at the |
| 100 // time of |context| destruction it will be flushed. |
| 101 static ui::Clipboard::SourceTag GetMarkerForOffTheRecordContext( |
| 102 BrowserContext* context); |
| 103 |
97 virtual ~BrowserContext(); | 104 virtual ~BrowserContext(); |
98 | 105 |
99 // Returns the path of the directory where this context's data is stored. | 106 // Returns the path of the directory where this context's data is stored. |
100 virtual base::FilePath GetPath() = 0; | 107 virtual base::FilePath GetPath() = 0; |
101 | 108 |
102 // Return whether this context is incognito. Default is false. | 109 // Return whether this context is incognito. Default is false. |
103 // This doesn't belong here; http://crbug.com/89628 | 110 // This doesn't belong here; http://crbug.com/89628 |
104 virtual bool IsOffTheRecord() const = 0; | 111 virtual bool IsOffTheRecord() const = 0; |
105 | 112 |
106 // Returns the request context information associated with this context. Call | 113 // Returns the request context information associated with this context. Call |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 struct hash<content::BrowserContext*> { | 167 struct hash<content::BrowserContext*> { |
161 std::size_t operator()(content::BrowserContext* const& p) const { | 168 std::size_t operator()(content::BrowserContext* const& p) const { |
162 return reinterpret_cast<std::size_t>(p); | 169 return reinterpret_cast<std::size_t>(p); |
163 } | 170 } |
164 }; | 171 }; |
165 | 172 |
166 } // namespace BASE_HASH_NAMESPACE | 173 } // namespace BASE_HASH_NAMESPACE |
167 #endif | 174 #endif |
168 | 175 |
169 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 176 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
OLD | NEW |