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 17 matching lines...) Expand all Loading... |
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" | 31 #include "net/base/data_url.h" |
32 #include "net/base/mime_util.h" | 32 #include "net/base/mime_util.h" |
33 #include "net/base/net_errors.h" | 33 #include "net/base/net_errors.h" |
34 #include "third_party/WebKit/public/platform/WebCookie.h" | 34 #include "third_party/WebKit/public/platform/WebCookie.h" |
35 #include "third_party/WebKit/public/platform/WebData.h" | 35 #include "third_party/WebKit/public/platform/WebData.h" |
36 #include "third_party/WebKit/public/platform/WebDiscardableMemory.h" | 36 #include "third_party/WebKit/public/platform/WebDiscardableMemory.h" |
37 #include "third_party/WebKit/public/platform/WebGestureCurve.h" | 37 #include "third_party/WebKit/public/platform/WebGestureCurve.h" |
38 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" | |
39 #include "third_party/WebKit/public/platform/WebString.h" | 38 #include "third_party/WebKit/public/platform/WebString.h" |
40 #include "third_party/WebKit/public/platform/WebURL.h" | 39 #include "third_party/WebKit/public/platform/WebURL.h" |
41 #include "third_party/WebKit/public/platform/WebVector.h" | 40 #include "third_party/WebKit/public/platform/WebVector.h" |
42 #include "third_party/WebKit/public/web/WebFrameClient.h" | 41 #include "third_party/WebKit/public/web/WebFrameClient.h" |
43 #include "third_party/WebKit/public/web/WebInputEvent.h" | 42 #include "third_party/WebKit/public/web/WebInputEvent.h" |
44 #include "third_party/WebKit/public/web/WebScreenInfo.h" | 43 #include "third_party/WebKit/public/web/WebScreenInfo.h" |
45 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" | 44 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" |
46 #include "ui/base/layout.h" | 45 #include "ui/base/layout.h" |
47 #include "webkit/common/user_agent/user_agent.h" | 46 #include "webkit/common/user_agent/user_agent.h" |
48 #include "webkit/glue/webkit_glue.h" | 47 #include "webkit/glue/webkit_glue.h" |
49 #include "webkit/glue/websocketstreamhandle_impl.h" | 48 #include "webkit/glue/websocketstreamhandle_impl.h" |
50 #include "webkit/glue/weburlloader_impl.h" | 49 #include "webkit/glue/weburlloader_impl.h" |
51 #include "webkit/plugins/webplugininfo.h" | |
52 | 50 |
53 using WebKit::WebAudioBus; | 51 using WebKit::WebAudioBus; |
54 using WebKit::WebCookie; | 52 using WebKit::WebCookie; |
55 using WebKit::WebData; | 53 using WebKit::WebData; |
56 using WebKit::WebLocalizedString; | 54 using WebKit::WebLocalizedString; |
57 using WebKit::WebPluginListBuilder; | 55 using WebKit::WebPluginListBuilder; |
58 using WebKit::WebString; | 56 using WebKit::WebString; |
59 using WebKit::WebSocketStreamHandle; | 57 using WebKit::WebSocketStreamHandle; |
60 using WebKit::WebURL; | 58 using WebKit::WebURL; |
61 using WebKit::WebURLError; | 59 using WebKit::WebURLError; |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 return data; | 378 return data; |
381 } | 379 } |
382 return WebData(); | 380 return WebData(); |
383 } | 381 } |
384 | 382 |
385 WebURLError WebKitPlatformSupportImpl::cancelledError( | 383 WebURLError WebKitPlatformSupportImpl::cancelledError( |
386 const WebURL& unreachableURL) const { | 384 const WebURL& unreachableURL) const { |
387 return WebURLLoaderImpl::CreateError(unreachableURL, net::ERR_ABORTED); | 385 return WebURLLoaderImpl::CreateError(unreachableURL, net::ERR_ABORTED); |
388 } | 386 } |
389 | 387 |
390 void WebKitPlatformSupportImpl::getPluginList(bool refresh, | |
391 WebPluginListBuilder* builder) { | |
392 std::vector<webkit::WebPluginInfo> plugins; | |
393 GetPlugins(refresh, &plugins); | |
394 | |
395 for (size_t i = 0; i < plugins.size(); ++i) { | |
396 const webkit::WebPluginInfo& plugin = plugins[i]; | |
397 | |
398 builder->addPlugin( | |
399 plugin.name, plugin.desc, | |
400 plugin.path.BaseName().AsUTF16Unsafe()); | |
401 | |
402 for (size_t j = 0; j < plugin.mime_types.size(); ++j) { | |
403 const webkit::WebPluginMimeType& mime_type = plugin.mime_types[j]; | |
404 | |
405 builder->addMediaTypeToLastPlugin( | |
406 WebString::fromUTF8(mime_type.mime_type), mime_type.description); | |
407 | |
408 for (size_t k = 0; k < mime_type.file_extensions.size(); ++k) { | |
409 builder->addFileExtensionToLastMediaType( | |
410 UTF8ToUTF16(mime_type.file_extensions[k])); | |
411 } | |
412 } | |
413 } | |
414 } | |
415 | |
416 void WebKitPlatformSupportImpl::decrementStatsCounter(const char* name) { | 388 void WebKitPlatformSupportImpl::decrementStatsCounter(const char* name) { |
417 base::StatsCounter(name).Decrement(); | 389 base::StatsCounter(name).Decrement(); |
418 } | 390 } |
419 | 391 |
420 void WebKitPlatformSupportImpl::incrementStatsCounter(const char* name) { | 392 void WebKitPlatformSupportImpl::incrementStatsCounter(const char* name) { |
421 base::StatsCounter(name).Increment(); | 393 base::StatsCounter(name).Increment(); |
422 } | 394 } |
423 | 395 |
424 void WebKitPlatformSupportImpl::histogramCustomCounts( | 396 void WebKitPlatformSupportImpl::histogramCustomCounts( |
425 const char* name, int sample, int min, int max, int bucket_count) { | 397 const char* name, int sample, int min, int max, int bucket_count) { |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 if (--shared_timer_suspended_ == 0 && | 885 if (--shared_timer_suspended_ == 0 && |
914 (!shared_timer_.IsRunning() || | 886 (!shared_timer_.IsRunning() || |
915 shared_timer_fire_time_was_set_while_suspended_)) { | 887 shared_timer_fire_time_was_set_while_suspended_)) { |
916 shared_timer_fire_time_was_set_while_suspended_ = false; | 888 shared_timer_fire_time_was_set_while_suspended_ = false; |
917 setSharedTimerFireInterval( | 889 setSharedTimerFireInterval( |
918 shared_timer_fire_time_ - monotonicallyIncreasingTime()); | 890 shared_timer_fire_time_ - monotonicallyIncreasingTime()); |
919 } | 891 } |
920 } | 892 } |
921 | 893 |
922 } // namespace webkit_glue | 894 } // namespace webkit_glue |
OLD | NEW |