Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 273193004: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing files. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 // static 606 // static
607 ProfileIOData* ProfileIOData::FromResourceContext( 607 ProfileIOData* ProfileIOData::FromResourceContext(
608 content::ResourceContext* rc) { 608 content::ResourceContext* rc) {
609 return (static_cast<ResourceContext*>(rc))->io_data_; 609 return (static_cast<ResourceContext*>(rc))->io_data_;
610 } 610 }
611 611
612 // static 612 // static
613 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { 613 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) {
614 DCHECK_EQ(scheme, StringToLowerASCII(scheme)); 614 DCHECK_EQ(scheme, StringToLowerASCII(scheme));
615 static const char* const kProtocolList[] = { 615 static const char* const kProtocolList[] = {
616 content::kFileScheme, 616 url::kFileScheme,
617 content::kChromeDevToolsScheme, 617 content::kChromeDevToolsScheme,
618 chrome::kDomDistillerScheme, 618 chrome::kDomDistillerScheme,
619 extensions::kExtensionScheme, 619 extensions::kExtensionScheme,
620 extensions::kExtensionResourceScheme, 620 extensions::kExtensionResourceScheme,
621 content::kChromeUIScheme, 621 content::kChromeUIScheme,
622 content::kDataScheme, 622 url::kDataScheme,
623 #if defined(OS_CHROMEOS) 623 #if defined(OS_CHROMEOS)
624 chrome::kDriveScheme, 624 chrome::kDriveScheme,
625 #endif // defined(OS_CHROMEOS) 625 #endif // defined(OS_CHROMEOS)
626 content::kAboutScheme, 626 content::kAboutScheme,
627 #if !defined(DISABLE_FTP_SUPPORT) 627 #if !defined(DISABLE_FTP_SUPPORT)
628 content::kFtpScheme, 628 url::kFtpScheme,
629 #endif // !defined(DISABLE_FTP_SUPPORT) 629 #endif // !defined(DISABLE_FTP_SUPPORT)
630 content::kBlobScheme, 630 url::kBlobScheme,
631 content::kFileSystemScheme, 631 url::kFileSystemScheme,
632 chrome::kChromeSearchScheme, 632 chrome::kChromeSearchScheme,
633 }; 633 };
634 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { 634 for (size_t i = 0; i < arraysize(kProtocolList); ++i) {
635 if (scheme == kProtocolList[i]) 635 if (scheme == kProtocolList[i])
636 return true; 636 return true;
637 } 637 }
638 return net::URLRequest::IsHandledProtocol(scheme); 638 return net::URLRequest::IsHandledProtocol(scheme);
639 } 639 }
640 640
641 // static 641 // static
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( 1024 scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults(
1025 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory, 1025 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory,
1026 content::ProtocolHandlerScopedVector protocol_interceptors, 1026 content::ProtocolHandlerScopedVector protocol_interceptors,
1027 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 1027 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
1028 protocol_handler_interceptor, 1028 protocol_handler_interceptor,
1029 net::NetworkDelegate* network_delegate, 1029 net::NetworkDelegate* network_delegate,
1030 net::FtpTransactionFactory* ftp_transaction_factory) const { 1030 net::FtpTransactionFactory* ftp_transaction_factory) const {
1031 // NOTE(willchan): Keep these protocol handlers in sync with 1031 // NOTE(willchan): Keep these protocol handlers in sync with
1032 // ProfileIOData::IsHandledProtocol(). 1032 // ProfileIOData::IsHandledProtocol().
1033 bool set_protocol = job_factory->SetProtocolHandler( 1033 bool set_protocol = job_factory->SetProtocolHandler(
1034 content::kFileScheme, 1034 url::kFileScheme,
1035 new net::FileProtocolHandler( 1035 new net::FileProtocolHandler(
1036 content::BrowserThread::GetBlockingPool()-> 1036 content::BrowserThread::GetBlockingPool()->
1037 GetTaskRunnerWithShutdownBehavior( 1037 GetTaskRunnerWithShutdownBehavior(
1038 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); 1038 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
1039 DCHECK(set_protocol); 1039 DCHECK(set_protocol);
1040 1040
1041 DCHECK(extension_info_map_.get()); 1041 DCHECK(extension_info_map_.get());
1042 // Check only for incognito (and not Chrome OS guest mode GUEST_PROFILE). 1042 // Check only for incognito (and not Chrome OS guest mode GUEST_PROFILE).
1043 bool is_incognito = profile_type() == Profile::INCOGNITO_PROFILE; 1043 bool is_incognito = profile_type() == Profile::INCOGNITO_PROFILE;
1044 set_protocol = job_factory->SetProtocolHandler( 1044 set_protocol = job_factory->SetProtocolHandler(
1045 extensions::kExtensionScheme, 1045 extensions::kExtensionScheme,
1046 extensions::CreateExtensionProtocolHandler(is_incognito, 1046 extensions::CreateExtensionProtocolHandler(is_incognito,
1047 extension_info_map_.get())); 1047 extension_info_map_.get()));
1048 DCHECK(set_protocol); 1048 DCHECK(set_protocol);
1049 set_protocol = job_factory->SetProtocolHandler( 1049 set_protocol = job_factory->SetProtocolHandler(
1050 extensions::kExtensionResourceScheme, 1050 extensions::kExtensionResourceScheme,
1051 CreateExtensionResourceProtocolHandler()); 1051 CreateExtensionResourceProtocolHandler());
1052 DCHECK(set_protocol); 1052 DCHECK(set_protocol);
1053 set_protocol = job_factory->SetProtocolHandler( 1053 set_protocol = job_factory->SetProtocolHandler(
1054 content::kDataScheme, new net::DataProtocolHandler()); 1054 url::kDataScheme, new net::DataProtocolHandler());
1055 DCHECK(set_protocol); 1055 DCHECK(set_protocol);
1056 #if defined(OS_CHROMEOS) 1056 #if defined(OS_CHROMEOS)
1057 if (!IsOffTheRecord() && profile_params_) { 1057 if (!IsOffTheRecord() && profile_params_) {
1058 set_protocol = job_factory->SetProtocolHandler( 1058 set_protocol = job_factory->SetProtocolHandler(
1059 chrome::kDriveScheme, 1059 chrome::kDriveScheme,
1060 new drive::DriveProtocolHandler(profile_params_->profile)); 1060 new drive::DriveProtocolHandler(profile_params_->profile));
1061 DCHECK(set_protocol); 1061 DCHECK(set_protocol);
1062 } 1062 }
1063 #endif // defined(OS_CHROMEOS) 1063 #endif // defined(OS_CHROMEOS)
1064 1064
1065 job_factory->SetProtocolHandler( 1065 job_factory->SetProtocolHandler(
1066 content::kAboutScheme, new chrome_browser_net::AboutProtocolHandler()); 1066 content::kAboutScheme, new chrome_browser_net::AboutProtocolHandler());
1067 #if !defined(DISABLE_FTP_SUPPORT) 1067 #if !defined(DISABLE_FTP_SUPPORT)
1068 DCHECK(ftp_transaction_factory); 1068 DCHECK(ftp_transaction_factory);
1069 job_factory->SetProtocolHandler( 1069 job_factory->SetProtocolHandler(
1070 content::kFtpScheme, 1070 url::kFtpScheme,
1071 new net::FtpProtocolHandler(ftp_transaction_factory)); 1071 new net::FtpProtocolHandler(ftp_transaction_factory));
1072 #endif // !defined(DISABLE_FTP_SUPPORT) 1072 #endif // !defined(DISABLE_FTP_SUPPORT)
1073 1073
1074 #if defined(DEBUG_DEVTOOLS) 1074 #if defined(DEBUG_DEVTOOLS)
1075 protocol_interceptors.push_back(new DebugDevToolsInterceptor); 1075 protocol_interceptors.push_back(new DebugDevToolsInterceptor);
1076 #endif 1076 #endif
1077 1077
1078 // Set up interceptors in the reverse order. 1078 // Set up interceptors in the reverse order.
1079 scoped_ptr<net::URLRequestJobFactory> top_job_factory = 1079 scoped_ptr<net::URLRequestJobFactory> top_job_factory =
1080 job_factory.PassAs<net::URLRequestJobFactory>(); 1080 job_factory.PassAs<net::URLRequestJobFactory>();
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 void ProfileIOData::SetCookieSettingsForTesting( 1169 void ProfileIOData::SetCookieSettingsForTesting(
1170 CookieSettings* cookie_settings) { 1170 CookieSettings* cookie_settings) {
1171 DCHECK(!cookie_settings_.get()); 1171 DCHECK(!cookie_settings_.get());
1172 cookie_settings_ = cookie_settings; 1172 cookie_settings_ = cookie_settings;
1173 } 1173 }
1174 1174
1175 void ProfileIOData::set_signin_names_for_testing( 1175 void ProfileIOData::set_signin_names_for_testing(
1176 SigninNamesOnIOThread* signin_names) { 1176 SigninNamesOnIOThread* signin_names) {
1177 signin_names_.reset(signin_names); 1177 signin_names_.reset(signin_names);
1178 } 1178 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/renderer_context_menu/render_view_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698