OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "extensions/shell/browser/shell_browser_context.h" | 5 #include "extensions/shell/browser/shell_browser_context.h" |
6 | 6 |
| 7 #include "content/public/browser/browser_thread.h" |
| 8 #include "extensions/browser/extension_network_delegate.h" |
| 9 #include "extensions/browser/extension_url_request_context_getter.h" |
7 #include "extensions/browser/guest_view/guest_view_manager.h" | 10 #include "extensions/browser/guest_view/guest_view_manager.h" |
8 #include "extensions/shell/browser/shell_special_storage_policy.h" | 11 #include "extensions/shell/browser/shell_special_storage_policy.h" |
9 | 12 |
10 namespace extensions { | 13 namespace extensions { |
11 | 14 |
12 // Create a normal recording browser context. If we used an incognito context | 15 // Create a normal recording browser context. If we used an incognito context |
13 // then app_shell would also have to create a normal context and manage both. | 16 // then app_shell would also have to create a normal context and manage both. |
14 ShellBrowserContext::ShellBrowserContext() | 17 ShellBrowserContext::ShellBrowserContext() |
15 : content::ShellBrowserContext(false, NULL), | 18 : content::ShellBrowserContext(false, NULL), |
16 storage_policy_(new ShellSpecialStoragePolicy) { | 19 storage_policy_(new ShellSpecialStoragePolicy) { |
17 } | 20 } |
18 | 21 |
19 ShellBrowserContext::~ShellBrowserContext() { | 22 ShellBrowserContext::~ShellBrowserContext() { |
20 } | 23 } |
21 | 24 |
22 content::BrowserPluginGuestManager* ShellBrowserContext::GetGuestManager() { | 25 content::BrowserPluginGuestManager* ShellBrowserContext::GetGuestManager() { |
23 return GuestViewManager::FromBrowserContext(this); | 26 return GuestViewManager::FromBrowserContext(this); |
24 } | 27 } |
25 | 28 |
26 storage::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { | 29 storage::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { |
27 return storage_policy_.get(); | 30 return storage_policy_.get(); |
28 } | 31 } |
29 | 32 |
| 33 content::ShellURLRequestContextGetter* |
| 34 ShellBrowserContext::CreateURLRequestContextGetter( |
| 35 content::ProtocolHandlerMap* protocol_handlers, |
| 36 content::URLRequestInterceptorScopedVector request_interceptors) { |
| 37 return new extensions::ExtensionURLRequestContextGetter( |
| 38 ignore_certificate_errors(), |
| 39 GetPath(), |
| 40 content::BrowserThread::UnsafeGetMessageLoopForThread( |
| 41 content::BrowserThread::IO), |
| 42 content::BrowserThread::UnsafeGetMessageLoopForThread( |
| 43 content::BrowserThread::FILE), |
| 44 protocol_handlers, |
| 45 request_interceptors.Pass(), |
| 46 net_log()); |
| 47 } |
| 48 |
| 49 net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext( |
| 50 content::ProtocolHandlerMap* protocol_handlers, |
| 51 content::URLRequestInterceptorScopedVector request_interceptors, |
| 52 content::BrowserContext* browser_context, |
| 53 InfoMap* extension_info_map) { |
| 54 ExtensionNetworkDelegate* extension_network_delegate = |
| 55 new ExtensionNetworkDelegate(); |
| 56 extension_network_delegate->set_extension_info_map(extension_info_map); |
| 57 extension_network_delegate->set_browser_context(browser_context); |
| 58 |
| 59 return content::ShellBrowserContext::CreateRequestContext( |
| 60 protocol_handlers, |
| 61 request_interceptors.Pass(), |
| 62 extension_network_delegate); |
| 63 } |
| 64 |
30 void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext1() { | 65 void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext1() { |
31 NOTREACHED(); | 66 NOTREACHED(); |
32 } | 67 } |
33 void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext2() { | 68 void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext2() { |
34 NOTREACHED(); | 69 NOTREACHED(); |
35 } | 70 } |
36 void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext3() { | 71 void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext3() { |
37 NOTREACHED(); | 72 NOTREACHED(); |
38 } | 73 } |
39 void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext4() { | 74 void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext4() { |
(...skipping 27 matching lines...) Expand all Loading... |
67 NOTREACHED(); | 102 NOTREACHED(); |
68 } | 103 } |
69 void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext14() { | 104 void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext14() { |
70 NOTREACHED(); | 105 NOTREACHED(); |
71 } | 106 } |
72 void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext15() { | 107 void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext15() { |
73 NOTREACHED(); | 108 NOTREACHED(); |
74 } | 109 } |
75 | 110 |
76 } // namespace extensions | 111 } // namespace extensions |
OLD | NEW |