OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ | 5 #ifndef EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ |
6 #define EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ | 6 #define EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 content::BrowserContext* GetBrowserContext() const; | 124 content::BrowserContext* GetBrowserContext() const; |
125 | 125 |
126 // Sets callbacks for testing keepalive impulse behavior. | 126 // Sets callbacks for testing keepalive impulse behavior. |
127 typedef base::Callback<void(const std::string& extension_id)> | 127 typedef base::Callback<void(const std::string& extension_id)> |
128 ImpulseCallbackForTesting; | 128 ImpulseCallbackForTesting; |
129 void SetKeepaliveImpulseCallbackForTesting( | 129 void SetKeepaliveImpulseCallbackForTesting( |
130 const ImpulseCallbackForTesting& callback); | 130 const ImpulseCallbackForTesting& callback); |
131 void SetKeepaliveImpulseDecrementCallbackForTesting( | 131 void SetKeepaliveImpulseDecrementCallbackForTesting( |
132 const ImpulseCallbackForTesting& callback); | 132 const ImpulseCallbackForTesting& callback); |
133 | 133 |
| 134 // Creates an incognito-context instance for tests. Tests for non-incognito |
| 135 // contexts can just use Create() above. |
| 136 static ProcessManager* CreateIncognitoForTesting( |
| 137 content::BrowserContext* incognito_context, |
| 138 content::BrowserContext* original_context, |
| 139 ProcessManager* original_manager); |
| 140 |
134 protected: | 141 protected: |
135 // If |context| is incognito pass the master context as |original_context|. | 142 // If |context| is incognito pass the master context as |original_context|. |
136 // Otherwise pass the same context for both. | 143 // Otherwise pass the same context for both. |
137 ProcessManager(content::BrowserContext* context, | 144 ProcessManager(content::BrowserContext* context, |
138 content::BrowserContext* original_context); | 145 content::BrowserContext* original_context); |
139 | 146 |
140 // Called on browser shutdown to close our extension hosts. | 147 // Called on browser shutdown to close our extension hosts. |
141 void CloseBackgroundHosts(); | 148 void CloseBackgroundHosts(); |
142 | 149 |
143 // content::NotificationObserver: | 150 // content::NotificationObserver: |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 ImpulseCallbackForTesting keepalive_impulse_decrement_callback_for_testing_; | 239 ImpulseCallbackForTesting keepalive_impulse_decrement_callback_for_testing_; |
233 | 240 |
234 base::WeakPtrFactory<ProcessManager> weak_ptr_factory_; | 241 base::WeakPtrFactory<ProcessManager> weak_ptr_factory_; |
235 | 242 |
236 DISALLOW_COPY_AND_ASSIGN(ProcessManager); | 243 DISALLOW_COPY_AND_ASSIGN(ProcessManager); |
237 }; | 244 }; |
238 | 245 |
239 } // namespace extensions | 246 } // namespace extensions |
240 | 247 |
241 #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ | 248 #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ |
OLD | NEW |