| 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 "webkit/glue/webkitplatformsupport_impl.h" | 5 #include "webkit/glue/webkitplatformsupport_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "base/rand_util.h" | 21 #include "base/rand_util.h" |
| 22 #include "base/string_util.h" | 22 #include "base/string_util.h" |
| 23 #include "base/strings/string_number_conversions.h" | 23 #include "base/strings/string_number_conversions.h" |
| 24 #include "base/synchronization/lock.h" | 24 #include "base/synchronization/lock.h" |
| 25 #include "base/sys_info.h" | 25 #include "base/sys_info.h" |
| 26 #include "base/time.h" | 26 #include "base/time.h" |
| 27 #include "base/utf_string_conversions.h" | 27 #include "base/utf_string_conversions.h" |
| 28 #include "grit/webkit_chromium_resources.h" | 28 #include "grit/webkit_chromium_resources.h" |
| 29 #include "grit/webkit_resources.h" | 29 #include "grit/webkit_resources.h" |
| 30 #include "grit/webkit_strings.h" | 30 #include "grit/webkit_strings.h" |
| 31 #include "net/base/data_url.h" |
| 32 #include "net/base/mime_util.h" |
| 31 #include "net/base/net_errors.h" | 33 #include "net/base/net_errors.h" |
| 32 #include "third_party/WebKit/public/platform/WebCookie.h" | 34 #include "third_party/WebKit/public/platform/WebCookie.h" |
| 33 #include "third_party/WebKit/public/platform/WebData.h" | 35 #include "third_party/WebKit/public/platform/WebData.h" |
| 34 #include "third_party/WebKit/public/platform/WebDiscardableMemory.h" | 36 #include "third_party/WebKit/public/platform/WebDiscardableMemory.h" |
| 35 #include "third_party/WebKit/public/platform/WebGestureCurve.h" | 37 #include "third_party/WebKit/public/platform/WebGestureCurve.h" |
| 36 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" | 38 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" |
| 37 #include "third_party/WebKit/public/platform/WebString.h" | 39 #include "third_party/WebKit/public/platform/WebString.h" |
| 38 #include "third_party/WebKit/public/platform/WebURL.h" | 40 #include "third_party/WebKit/public/platform/WebURL.h" |
| 39 #include "third_party/WebKit/public/platform/WebVector.h" | 41 #include "third_party/WebKit/public/platform/WebVector.h" |
| 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 } | 398 } |
| 397 | 399 |
| 398 WebSocketStreamHandle* WebKitPlatformSupportImpl::createSocketStreamHandle() { | 400 WebSocketStreamHandle* WebKitPlatformSupportImpl::createSocketStreamHandle() { |
| 399 return new WebSocketStreamHandleImpl(this); | 401 return new WebSocketStreamHandleImpl(this); |
| 400 } | 402 } |
| 401 | 403 |
| 402 WebString WebKitPlatformSupportImpl::userAgent(const WebURL& url) { | 404 WebString WebKitPlatformSupportImpl::userAgent(const WebURL& url) { |
| 403 return WebString::fromUTF8(webkit_glue::GetUserAgent(url)); | 405 return WebString::fromUTF8(webkit_glue::GetUserAgent(url)); |
| 404 } | 406 } |
| 405 | 407 |
| 408 WebData WebKitPlatformSupportImpl::parseDataURL( |
| 409 const WebURL& url, |
| 410 WebString& mimetype_out, |
| 411 WebString& charset_out) { |
| 412 std::string mime_type, char_set, data; |
| 413 if (net::DataURL::Parse(url, &mime_type, &char_set, &data) |
| 414 && net::IsSupportedMimeType(mime_type)) { |
| 415 mimetype_out = WebString::fromUTF8(mime_type); |
| 416 charset_out = WebString::fromUTF8(char_set); |
| 417 return data; |
| 418 } |
| 419 return WebData(); |
| 420 } |
| 421 |
| 406 WebURLError WebKitPlatformSupportImpl::cancelledError( | 422 WebURLError WebKitPlatformSupportImpl::cancelledError( |
| 407 const WebURL& unreachableURL) const { | 423 const WebURL& unreachableURL) const { |
| 408 return WebURLLoaderImpl::CreateError(unreachableURL, net::ERR_ABORTED); | 424 return WebURLLoaderImpl::CreateError(unreachableURL, net::ERR_ABORTED); |
| 409 } | 425 } |
| 410 | 426 |
| 411 void WebKitPlatformSupportImpl::getPluginList(bool refresh, | 427 void WebKitPlatformSupportImpl::getPluginList(bool refresh, |
| 412 WebPluginListBuilder* builder) { | 428 WebPluginListBuilder* builder) { |
| 413 std::vector<webkit::WebPluginInfo> plugins; | 429 std::vector<webkit::WebPluginInfo> plugins; |
| 414 GetPlugins(refresh, &plugins); | 430 GetPlugins(refresh, &plugins); |
| 415 | 431 |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 } | 1016 } |
| 1001 | 1017 |
| 1002 #if defined(OS_ANDROID) | 1018 #if defined(OS_ANDROID) |
| 1003 webkit_media::WebAudioMediaCodecRunner | 1019 webkit_media::WebAudioMediaCodecRunner |
| 1004 WebKitPlatformSupportImpl::GetWebAudioMediaCodecRunner() { | 1020 WebKitPlatformSupportImpl::GetWebAudioMediaCodecRunner() { |
| 1005 return base::Bind(&NullRunWebAudioMediaCodec); | 1021 return base::Bind(&NullRunWebAudioMediaCodec); |
| 1006 } | 1022 } |
| 1007 #endif | 1023 #endif |
| 1008 | 1024 |
| 1009 } // namespace webkit_glue | 1025 } // namespace webkit_glue |
| OLD | NEW |