OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/blink_platform_impl.h" | 5 #include "content/child/blink_platform_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 return new WebURLLoaderImpl( | 420 return new WebURLLoaderImpl( |
421 child_thread ? child_thread->resource_dispatcher() : NULL, | 421 child_thread ? child_thread->resource_dispatcher() : NULL, |
422 make_scoped_ptr(currentThread()->getWebTaskRunner()->clone())); | 422 make_scoped_ptr(currentThread()->getWebTaskRunner()->clone())); |
423 } | 423 } |
424 | 424 |
425 blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() { | 425 blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() { |
426 return new WebSocketBridge; | 426 return new WebSocketBridge; |
427 } | 427 } |
428 | 428 |
429 WebString BlinkPlatformImpl::userAgent() { | 429 WebString BlinkPlatformImpl::userAgent() { |
430 CR_DEFINE_STATIC_LOCAL( | 430 return blink::WebString::fromUTF8(GetContentClient()->GetUserAgent()); |
431 blink::WebString, user_agent, | |
432 (blink::WebString::fromUTF8(GetContentClient()->GetUserAgent()))); | |
433 DCHECK(user_agent == | |
434 blink::WebString::fromUTF8(GetContentClient()->GetUserAgent())); | |
435 return user_agent; | |
436 } | 431 } |
437 | 432 |
438 WebData BlinkPlatformImpl::parseDataURL(const WebURL& url, | 433 WebData BlinkPlatformImpl::parseDataURL(const WebURL& url, |
439 WebString& mimetype_out, | 434 WebString& mimetype_out, |
440 WebString& charset_out) { | 435 WebString& charset_out) { |
441 std::string mime_type, char_set, data; | 436 std::string mime_type, char_set, data; |
442 if (net::DataURL::Parse(url, &mime_type, &char_set, &data) && | 437 if (net::DataURL::Parse(url, &mime_type, &char_set, &data) && |
443 mime_util::IsSupportedMimeType(mime_type)) { | 438 mime_util::IsSupportedMimeType(mime_type)) { |
444 mimetype_out = WebString::fromUTF8(mime_type); | 439 mimetype_out = WebString::fromUTF8(mime_type); |
445 charset_out = WebString::fromUTF8(char_set); | 440 charset_out = WebString::fromUTF8(char_set); |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( | 1019 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( |
1025 static_cast<ui::DomKey>(dom_key))); | 1020 static_cast<ui::DomKey>(dom_key))); |
1026 } | 1021 } |
1027 | 1022 |
1028 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 1023 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
1029 return static_cast<int>( | 1024 return static_cast<int>( |
1030 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 1025 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
1031 } | 1026 } |
1032 | 1027 |
1033 } // namespace content | 1028 } // namespace content |
OLD | NEW |