| 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 "android_webview/browser/aw_content_browser_client.h" | 5 #include "android_webview/browser/aw_content_browser_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
| 10 #include "android_webview/browser/aw_browser_main_parts.h" | 10 #include "android_webview/browser/aw_browser_main_parts.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 // We handle error cases. | 226 // We handle error cases. |
| 227 return true; | 227 return true; |
| 228 } | 228 } |
| 229 | 229 |
| 230 const std::string scheme = url.scheme(); | 230 const std::string scheme = url.scheme(); |
| 231 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); | 231 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); |
| 232 // See CreateJobFactory in aw_url_request_context_getter.cc for the | 232 // See CreateJobFactory in aw_url_request_context_getter.cc for the |
| 233 // list of protocols that are handled. | 233 // list of protocols that are handled. |
| 234 // TODO(mnaganov): Make this automatic. | 234 // TODO(mnaganov): Make this automatic. |
| 235 static const char* const kProtocolList[] = { | 235 static const char* const kProtocolList[] = { |
| 236 url::kDataScheme, | 236 url::kDataScheme, |
| 237 url::kBlobScheme, | 237 url::kBlobScheme, |
| 238 url::kFileSystemScheme, | 238 url::kFileSystemScheme, |
| 239 content::kChromeUIScheme, | 239 content::kChromeUIScheme, |
| 240 content::kChromeDevToolsScheme, | 240 content::kChromeDevToolsScheme, |
| 241 url::kContentScheme, | 241 url::kContentScheme, |
| 242 url::kHttpScheme, |
| 243 url::kHttpsScheme, |
| 244 url::kWsScheme, |
| 245 url::kWssScheme, |
| 242 }; | 246 }; |
| 243 if (scheme == url::kFileScheme) { | 247 if (scheme == url::kFileScheme) { |
| 244 // Return false for the "special" file URLs, so they can be loaded | 248 // Return false for the "special" file URLs, so they can be loaded |
| 245 // even if access to file: scheme is not granted to the child process. | 249 // even if access to file: scheme is not granted to the child process. |
| 246 return !IsAndroidSpecialFileUrl(url); | 250 return !IsAndroidSpecialFileUrl(url); |
| 247 } | 251 } |
| 248 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { | 252 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { |
| 249 if (scheme == kProtocolList[i]) | 253 if (scheme == kProtocolList[i]) |
| 250 return true; | 254 return true; |
| 251 } | 255 } |
| 252 return net::URLRequest::IsHandledProtocol(scheme); | 256 return false; |
| 253 } | 257 } |
| 254 | 258 |
| 255 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( | 259 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( |
| 256 const std::string& alias_name) { | 260 const std::string& alias_name) { |
| 257 return alias_name; | 261 return alias_name; |
| 258 } | 262 } |
| 259 | 263 |
| 260 void AwContentBrowserClient::AppendExtraCommandLineSwitches( | 264 void AwContentBrowserClient::AppendExtraCommandLineSwitches( |
| 261 base::CommandLine* command_line, | 265 base::CommandLine* command_line, |
| 262 int child_process_id) { | 266 int child_process_id) { |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 } | 520 } |
| 517 return throttles; | 521 return throttles; |
| 518 } | 522 } |
| 519 | 523 |
| 520 content::DevToolsManagerDelegate* | 524 content::DevToolsManagerDelegate* |
| 521 AwContentBrowserClient::GetDevToolsManagerDelegate() { | 525 AwContentBrowserClient::GetDevToolsManagerDelegate() { |
| 522 return new AwDevToolsManagerDelegate(); | 526 return new AwDevToolsManagerDelegate(); |
| 523 } | 527 } |
| 524 | 528 |
| 525 } // namespace android_webview | 529 } // namespace android_webview |
| OLD | NEW |