| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 // We handle error cases. | 237 // We handle error cases. |
| 238 return true; | 238 return true; |
| 239 } | 239 } |
| 240 | 240 |
| 241 const std::string scheme = url.scheme(); | 241 const std::string scheme = url.scheme(); |
| 242 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); | 242 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); |
| 243 // See CreateJobFactory in aw_url_request_context_getter.cc for the | 243 // See CreateJobFactory in aw_url_request_context_getter.cc for the |
| 244 // list of protocols that are handled. | 244 // list of protocols that are handled. |
| 245 // TODO(mnaganov): Make this automatic. | 245 // TODO(mnaganov): Make this automatic. |
| 246 static const char* const kProtocolList[] = { | 246 static const char* const kProtocolList[] = { |
| 247 url::kDataScheme, | 247 url::kDataScheme, |
| 248 url::kBlobScheme, | 248 url::kBlobScheme, |
| 249 url::kFileSystemScheme, | 249 url::kFileSystemScheme, |
| 250 content::kChromeUIScheme, | 250 content::kChromeUIScheme, |
| 251 content::kChromeDevToolsScheme, | 251 content::kChromeDevToolsScheme, |
| 252 url::kContentScheme, | 252 url::kContentScheme, |
| 253 url::kHttpScheme, |
| 254 url::kHttpsScheme, |
| 255 url::kWsScheme, |
| 256 url::kWssScheme, |
| 253 }; | 257 }; |
| 254 if (scheme == url::kFileScheme) { | 258 if (scheme == url::kFileScheme) { |
| 255 // Return false for the "special" file URLs, so they can be loaded | 259 // Return false for the "special" file URLs, so they can be loaded |
| 256 // even if access to file: scheme is not granted to the child process. | 260 // even if access to file: scheme is not granted to the child process. |
| 257 return !IsAndroidSpecialFileUrl(url); | 261 return !IsAndroidSpecialFileUrl(url); |
| 258 } | 262 } |
| 259 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { | 263 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { |
| 260 if (scheme == kProtocolList[i]) | 264 if (scheme == kProtocolList[i]) |
| 261 return true; | 265 return true; |
| 262 } | 266 } |
| 263 return net::URLRequest::IsHandledProtocol(scheme); | 267 return false; |
| 264 } | 268 } |
| 265 | 269 |
| 266 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( | 270 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( |
| 267 const std::string& alias_name) { | 271 const std::string& alias_name) { |
| 268 return alias_name; | 272 return alias_name; |
| 269 } | 273 } |
| 270 | 274 |
| 271 void AwContentBrowserClient::AppendExtraCommandLineSwitches( | 275 void AwContentBrowserClient::AppendExtraCommandLineSwitches( |
| 272 base::CommandLine* command_line, | 276 base::CommandLine* command_line, |
| 273 int child_process_id) { | 277 int child_process_id) { |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 | 542 |
| 539 #if defined(VIDEO_HOLE) | 543 #if defined(VIDEO_HOLE) |
| 540 content::ExternalVideoSurfaceContainer* | 544 content::ExternalVideoSurfaceContainer* |
| 541 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( | 545 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( |
| 542 content::WebContents* web_contents) { | 546 content::WebContents* web_contents) { |
| 543 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); | 547 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); |
| 544 } | 548 } |
| 545 #endif | 549 #endif |
| 546 | 550 |
| 547 } // namespace android_webview | 551 } // namespace android_webview |
| OLD | NEW |