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 #include "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 return false; | 802 return false; |
803 } | 803 } |
804 } | 804 } |
805 | 805 |
806 // Hosted apps that have script access to their background page must use | 806 // Hosted apps that have script access to their background page must use |
807 // process per site, since all instances can make synchronous calls to the | 807 // process per site, since all instances can make synchronous calls to the |
808 // background window. Other extensions should use process per site as well. | 808 // background window. Other extensions should use process per site as well. |
809 return true; | 809 return true; |
810 } | 810 } |
811 | 811 |
| 812 net::URLRequestContextGetter* |
| 813 ChromeContentBrowserClient::CreateRequestContext( |
| 814 content::BrowserContext* browser_context, |
| 815 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 816 blob_protocol_handler, |
| 817 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 818 file_system_protocol_handler, |
| 819 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 820 developer_protocol_handler, |
| 821 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 822 chrome_protocol_handler, |
| 823 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 824 chrome_devtools_protocol_handler) { |
| 825 Profile* profile = Profile::FromBrowserContext(browser_context); |
| 826 return profile->CreateRequestContext(blob_protocol_handler.Pass(), |
| 827 file_system_protocol_handler.Pass(), |
| 828 developer_protocol_handler.Pass(), |
| 829 chrome_protocol_handler.Pass(), |
| 830 chrome_devtools_protocol_handler.Pass()); |
| 831 } |
| 832 |
| 833 net::URLRequestContextGetter* |
| 834 ChromeContentBrowserClient::CreateRequestContextForStoragePartition( |
| 835 content::BrowserContext* browser_context, |
| 836 const FilePath& partition_path, |
| 837 bool in_memory, |
| 838 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 839 blob_protocol_handler, |
| 840 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 841 file_system_protocol_handler, |
| 842 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 843 developer_protocol_handler, |
| 844 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 845 chrome_protocol_handler, |
| 846 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 847 chrome_devtools_protocol_handler) { |
| 848 Profile* profile = Profile::FromBrowserContext(browser_context); |
| 849 return profile->CreateRequestContextForStoragePartition( |
| 850 partition_path, |
| 851 in_memory, |
| 852 blob_protocol_handler.Pass(), |
| 853 file_system_protocol_handler.Pass(), |
| 854 developer_protocol_handler.Pass(), |
| 855 chrome_protocol_handler.Pass(), |
| 856 chrome_devtools_protocol_handler.Pass()); |
| 857 } |
| 858 |
812 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) { | 859 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) { |
813 return ProfileIOData::IsHandledURL(url); | 860 return ProfileIOData::IsHandledURL(url); |
814 } | 861 } |
815 | 862 |
816 bool ChromeContentBrowserClient::IsSuitableHost( | 863 bool ChromeContentBrowserClient::IsSuitableHost( |
817 content::RenderProcessHost* process_host, | 864 content::RenderProcessHost* process_host, |
818 const GURL& site_url) { | 865 const GURL& site_url) { |
819 Profile* profile = | 866 Profile* profile = |
820 Profile::FromBrowserContext(process_host->GetBrowserContext()); | 867 Profile::FromBrowserContext(process_host->GetBrowserContext()); |
821 // This may be NULL during tests. In that case, just assume any site can | 868 // This may be NULL during tests. In that case, just assume any site can |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2046 io_thread_application_locale_ = locale; | 2093 io_thread_application_locale_ = locale; |
2047 } | 2094 } |
2048 | 2095 |
2049 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 2096 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
2050 const std::string& locale) { | 2097 const std::string& locale) { |
2051 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2098 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
2052 io_thread_application_locale_ = locale; | 2099 io_thread_application_locale_ = locale; |
2053 } | 2100 } |
2054 | 2101 |
2055 } // namespace chrome | 2102 } // namespace chrome |
OLD | NEW |