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/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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 using content::BrowserThread; | 125 using content::BrowserThread; |
126 using content::ResourceContext; | 126 using content::ResourceContext; |
127 | 127 |
128 namespace { | 128 namespace { |
129 | 129 |
130 #if defined(DEBUG_DEVTOOLS) | 130 #if defined(DEBUG_DEVTOOLS) |
131 bool IsSupportedDevToolsURL(const GURL& url, base::FilePath* path) { | 131 bool IsSupportedDevToolsURL(const GURL& url, base::FilePath* path) { |
132 std::string bundled_path_prefix(chrome::kChromeUIDevToolsBundledPath); | 132 std::string bundled_path_prefix(chrome::kChromeUIDevToolsBundledPath); |
133 bundled_path_prefix = "/" + bundled_path_prefix + "/"; | 133 bundled_path_prefix = "/" + bundled_path_prefix + "/"; |
134 | 134 |
135 if (!url.SchemeIs(chrome::kChromeDevToolsScheme) || | 135 if (!url.SchemeIs(content::kChromeDevToolsScheme) || |
136 url.host() != chrome::kChromeUIDevToolsHost || | 136 url.host() != chrome::kChromeUIDevToolsHost || |
137 !StartsWithASCII(url.path(), bundled_path_prefix, false)) { | 137 !StartsWithASCII(url.path(), bundled_path_prefix, false)) { |
138 return false; | 138 return false; |
139 } | 139 } |
140 | 140 |
141 if (!url.is_valid()) { | 141 if (!url.is_valid()) { |
142 NOTREACHED(); | 142 NOTREACHED(); |
143 return false; | 143 return false; |
144 } | 144 } |
145 | 145 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 ProfileIOData* ProfileIOData::FromResourceContext( | 600 ProfileIOData* ProfileIOData::FromResourceContext( |
601 content::ResourceContext* rc) { | 601 content::ResourceContext* rc) { |
602 return (static_cast<ResourceContext*>(rc))->io_data_; | 602 return (static_cast<ResourceContext*>(rc))->io_data_; |
603 } | 603 } |
604 | 604 |
605 // static | 605 // static |
606 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { | 606 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { |
607 DCHECK_EQ(scheme, StringToLowerASCII(scheme)); | 607 DCHECK_EQ(scheme, StringToLowerASCII(scheme)); |
608 static const char* const kProtocolList[] = { | 608 static const char* const kProtocolList[] = { |
609 content::kFileScheme, | 609 content::kFileScheme, |
610 chrome::kChromeDevToolsScheme, | 610 content::kChromeDevToolsScheme, |
611 chrome::kDomDistillerScheme, | 611 chrome::kDomDistillerScheme, |
612 extensions::kExtensionScheme, | 612 extensions::kExtensionScheme, |
613 extensions::kExtensionResourceScheme, | 613 extensions::kExtensionResourceScheme, |
614 content::kChromeUIScheme, | 614 content::kChromeUIScheme, |
615 content::kDataScheme, | 615 content::kDataScheme, |
616 #if defined(OS_CHROMEOS) | 616 #if defined(OS_CHROMEOS) |
617 chrome::kDriveScheme, | 617 chrome::kDriveScheme, |
618 #endif // defined(OS_CHROMEOS) | 618 #endif // defined(OS_CHROMEOS) |
619 chrome::kAboutScheme, | 619 chrome::kAboutScheme, |
620 #if !defined(DISABLE_FTP_SUPPORT) | 620 #if !defined(DISABLE_FTP_SUPPORT) |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 void ProfileIOData::SetCookieSettingsForTesting( | 1143 void ProfileIOData::SetCookieSettingsForTesting( |
1144 CookieSettings* cookie_settings) { | 1144 CookieSettings* cookie_settings) { |
1145 DCHECK(!cookie_settings_.get()); | 1145 DCHECK(!cookie_settings_.get()); |
1146 cookie_settings_ = cookie_settings; | 1146 cookie_settings_ = cookie_settings; |
1147 } | 1147 } |
1148 | 1148 |
1149 void ProfileIOData::set_signin_names_for_testing( | 1149 void ProfileIOData::set_signin_names_for_testing( |
1150 SigninNamesOnIOThread* signin_names) { | 1150 SigninNamesOnIOThread* signin_names) { |
1151 signin_names_.reset(signin_names); | 1151 signin_names_.reset(signin_names); |
1152 } | 1152 } |
OLD | NEW |