| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "components/guest_view/browser/guest_view_manager.h" |
| 8 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 9 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
| 10 #include "extensions/browser/guest_view/guest_view_manager.h" | |
| 11 #include "extensions/shell/browser/shell_network_delegate.h" | 11 #include "extensions/shell/browser/shell_network_delegate.h" |
| 12 #include "extensions/shell/browser/shell_special_storage_policy.h" | 12 #include "extensions/shell/browser/shell_special_storage_policy.h" |
| 13 #include "extensions/shell/browser/shell_url_request_context_getter.h" | 13 #include "extensions/shell/browser/shell_url_request_context_getter.h" |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 bool IgnoreCertificateErrors() { | 19 bool IgnoreCertificateErrors() { |
| 20 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 20 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 21 ::switches::kIgnoreCertificateErrors); | 21 ::switches::kIgnoreCertificateErrors); |
| 22 } | 22 } |
| 23 | 23 |
| 24 } // namespace | 24 } // namespace |
| 25 | 25 |
| 26 // Create a normal recording browser context. If we used an incognito context | 26 // Create a normal recording browser context. If we used an incognito context |
| 27 // then app_shell would also have to create a normal context and manage both. | 27 // then app_shell would also have to create a normal context and manage both. |
| 28 ShellBrowserContext::ShellBrowserContext() | 28 ShellBrowserContext::ShellBrowserContext() |
| 29 : content::ShellBrowserContext(false /* off_the_record */, | 29 : content::ShellBrowserContext(false /* off_the_record */, |
| 30 nullptr /* net_log */), | 30 nullptr /* net_log */), |
| 31 storage_policy_(new ShellSpecialStoragePolicy) { | 31 storage_policy_(new ShellSpecialStoragePolicy) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 ShellBrowserContext::~ShellBrowserContext() { | 34 ShellBrowserContext::~ShellBrowserContext() { |
| 35 } | 35 } |
| 36 | 36 |
| 37 content::BrowserPluginGuestManager* ShellBrowserContext::GetGuestManager() { | 37 content::BrowserPluginGuestManager* ShellBrowserContext::GetGuestManager() { |
| 38 return GuestViewManager::FromBrowserContext(this); | 38 return guestview::GuestViewManager::FromBrowserContext(this); |
| 39 } | 39 } |
| 40 | 40 |
| 41 storage::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { | 41 storage::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { |
| 42 return storage_policy_.get(); | 42 return storage_policy_.get(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext( | 45 net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext( |
| 46 content::ProtocolHandlerMap* protocol_handlers, | 46 content::ProtocolHandlerMap* protocol_handlers, |
| 47 content::URLRequestInterceptorScopedVector request_interceptors, | 47 content::URLRequestInterceptorScopedVector request_interceptors, |
| 48 InfoMap* extension_info_map) { | 48 InfoMap* extension_info_map) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 73 | 73 |
| 74 void ShellBrowserContext::InitURLRequestContextOnIOThread() { | 74 void ShellBrowserContext::InitURLRequestContextOnIOThread() { |
| 75 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 75 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 76 | 76 |
| 77 // GetURLRequestContext() will create a URLRequestContext if it isn't | 77 // GetURLRequestContext() will create a URLRequestContext if it isn't |
| 78 // initialized. | 78 // initialized. |
| 79 url_request_context_getter()->GetURLRequestContext(); | 79 url_request_context_getter()->GetURLRequestContext(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace extensions | 82 } // namespace extensions |
| OLD | NEW |