| 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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 return false; | 782 return false; |
| 783 } | 783 } |
| 784 } | 784 } |
| 785 | 785 |
| 786 // Hosted apps that have script access to their background page must use | 786 // Hosted apps that have script access to their background page must use |
| 787 // process per site, since all instances can make synchronous calls to the | 787 // process per site, since all instances can make synchronous calls to the |
| 788 // background window. Other extensions should use process per site as well. | 788 // background window. Other extensions should use process per site as well. |
| 789 return true; | 789 return true; |
| 790 } | 790 } |
| 791 | 791 |
| 792 // These are treated as WebUI schemes but do not get WebUI bindings. |
| 793 std::vector<std::string> |
| 794 ChromeContentBrowserClient::GetAdditionalWebUISchemes() { |
| 795 std::vector<std::string> additional_schemes; |
| 796 additional_schemes.push_back(chrome::kChromeSearchScheme); |
| 797 return additional_schemes; |
| 798 } |
| 799 |
| 792 net::URLRequestContextGetter* | 800 net::URLRequestContextGetter* |
| 793 ChromeContentBrowserClient::CreateRequestContext( | 801 ChromeContentBrowserClient::CreateRequestContext( |
| 794 content::BrowserContext* browser_context, | 802 content::BrowserContext* browser_context, |
| 795 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 803 content::ProtocolHandlerMap* protocol_handlers) { |
| 796 blob_protocol_handler, | |
| 797 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 798 file_system_protocol_handler, | |
| 799 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 800 developer_protocol_handler, | |
| 801 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 802 chrome_protocol_handler, | |
| 803 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 804 chrome_devtools_protocol_handler) { | |
| 805 Profile* profile = Profile::FromBrowserContext(browser_context); | 804 Profile* profile = Profile::FromBrowserContext(browser_context); |
| 806 return profile->CreateRequestContext(blob_protocol_handler.Pass(), | 805 return profile->CreateRequestContext(protocol_handlers); |
| 807 file_system_protocol_handler.Pass(), | |
| 808 developer_protocol_handler.Pass(), | |
| 809 chrome_protocol_handler.Pass(), | |
| 810 chrome_devtools_protocol_handler.Pass()); | |
| 811 } | 806 } |
| 812 | 807 |
| 813 net::URLRequestContextGetter* | 808 net::URLRequestContextGetter* |
| 814 ChromeContentBrowserClient::CreateRequestContextForStoragePartition( | 809 ChromeContentBrowserClient::CreateRequestContextForStoragePartition( |
| 815 content::BrowserContext* browser_context, | 810 content::BrowserContext* browser_context, |
| 816 const base::FilePath& partition_path, | 811 const base::FilePath& partition_path, |
| 817 bool in_memory, | 812 bool in_memory, |
| 818 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 813 content::ProtocolHandlerMap* protocol_handlers) { |
| 819 blob_protocol_handler, | |
| 820 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 821 file_system_protocol_handler, | |
| 822 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 823 developer_protocol_handler, | |
| 824 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 825 chrome_protocol_handler, | |
| 826 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 827 chrome_devtools_protocol_handler) { | |
| 828 Profile* profile = Profile::FromBrowserContext(browser_context); | 814 Profile* profile = Profile::FromBrowserContext(browser_context); |
| 829 return profile->CreateRequestContextForStoragePartition( | 815 return profile->CreateRequestContextForStoragePartition( |
| 830 partition_path, | 816 partition_path, in_memory, protocol_handlers); |
| 831 in_memory, | |
| 832 blob_protocol_handler.Pass(), | |
| 833 file_system_protocol_handler.Pass(), | |
| 834 developer_protocol_handler.Pass(), | |
| 835 chrome_protocol_handler.Pass(), | |
| 836 chrome_devtools_protocol_handler.Pass()); | |
| 837 } | 817 } |
| 838 | 818 |
| 839 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) { | 819 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) { |
| 840 return ProfileIOData::IsHandledURL(url); | 820 return ProfileIOData::IsHandledURL(url); |
| 841 } | 821 } |
| 842 | 822 |
| 843 bool ChromeContentBrowserClient::IsSuitableHost( | 823 bool ChromeContentBrowserClient::IsSuitableHost( |
| 844 content::RenderProcessHost* process_host, | 824 content::RenderProcessHost* process_host, |
| 845 const GURL& site_url) { | 825 const GURL& site_url) { |
| 846 Profile* profile = | 826 Profile* profile = |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2141 io_thread_application_locale_ = locale; | 2121 io_thread_application_locale_ = locale; |
| 2142 } | 2122 } |
| 2143 | 2123 |
| 2144 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 2124 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
| 2145 const std::string& locale) { | 2125 const std::string& locale) { |
| 2146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2126 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 2147 io_thread_application_locale_ = locale; | 2127 io_thread_application_locale_ = locale; |
| 2148 } | 2128 } |
| 2149 | 2129 |
| 2150 } // namespace chrome | 2130 } // namespace chrome |
| OLD | NEW |