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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 return false; | 682 return false; |
683 } | 683 } |
684 } | 684 } |
685 | 685 |
686 // Hosted apps that have script access to their background page must use | 686 // Hosted apps that have script access to their background page must use |
687 // process per site, since all instances can make synchronous calls to the | 687 // process per site, since all instances can make synchronous calls to the |
688 // background window. Other extensions should use process per site as well. | 688 // background window. Other extensions should use process per site as well. |
689 return true; | 689 return true; |
690 } | 690 } |
691 | 691 |
| 692 net::URLRequestContextGetter* |
| 693 ChromeContentBrowserClient::CreateRequestContext( |
| 694 content::BrowserContext* browser_context, |
| 695 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 696 blob_protocol_handler, |
| 697 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 698 file_system_protocol_handler, |
| 699 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 700 developer_protocol_handler) { |
| 701 Profile* profile = Profile::FromBrowserContext(browser_context); |
| 702 return profile->CreateRequestContext(blob_protocol_handler.Pass(), |
| 703 file_system_protocol_handler.Pass(), |
| 704 developer_protocol_handler.Pass()); |
| 705 } |
| 706 |
| 707 net::URLRequestContextGetter* |
| 708 ChromeContentBrowserClient::CreateRequestContextForStoragePartition( |
| 709 content::BrowserContext* browser_context, |
| 710 const FilePath& partition_path, |
| 711 bool in_memory, |
| 712 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 713 blob_protocol_handler, |
| 714 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 715 file_system_protocol_handler, |
| 716 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 717 developer_protocol_handler) { |
| 718 Profile* profile = Profile::FromBrowserContext(browser_context); |
| 719 return profile->CreateRequestContextForStoragePartition( |
| 720 partition_path, |
| 721 in_memory, |
| 722 blob_protocol_handler.Pass(), |
| 723 file_system_protocol_handler.Pass(), |
| 724 developer_protocol_handler.Pass()); |
| 725 } |
| 726 |
692 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) { | 727 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) { |
693 return ProfileIOData::IsHandledURL(url); | 728 return ProfileIOData::IsHandledURL(url); |
694 } | 729 } |
695 | 730 |
696 bool ChromeContentBrowserClient::IsSuitableHost( | 731 bool ChromeContentBrowserClient::IsSuitableHost( |
697 content::RenderProcessHost* process_host, | 732 content::RenderProcessHost* process_host, |
698 const GURL& site_url) { | 733 const GURL& site_url) { |
699 Profile* profile = | 734 Profile* profile = |
700 Profile::FromBrowserContext(process_host->GetBrowserContext()); | 735 Profile::FromBrowserContext(process_host->GetBrowserContext()); |
701 ExtensionService* service = | 736 ExtensionService* service = |
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1903 io_thread_application_locale_ = locale; | 1938 io_thread_application_locale_ = locale; |
1904 } | 1939 } |
1905 | 1940 |
1906 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 1941 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
1907 const std::string& locale) { | 1942 const std::string& locale) { |
1908 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1943 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
1909 io_thread_application_locale_ = locale; | 1944 io_thread_application_locale_ = locale; |
1910 } | 1945 } |
1911 | 1946 |
1912 } // namespace chrome | 1947 } // namespace chrome |
OLD | NEW |