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/plugins/ppapi/ppapi_plugin_instance.h" | 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
(...skipping 11 matching lines...) Expand all Loading... | |
22 #include "ppapi/c/pp_rect.h" | 22 #include "ppapi/c/pp_rect.h" |
23 #include "ppapi/c/ppb_audio_config.h" | 23 #include "ppapi/c/ppb_audio_config.h" |
24 #include "ppapi/c/ppb_core.h" | 24 #include "ppapi/c/ppb_core.h" |
25 #include "ppapi/c/ppb_gamepad.h" | 25 #include "ppapi/c/ppb_gamepad.h" |
26 #include "ppapi/c/ppp_input_event.h" | 26 #include "ppapi/c/ppp_input_event.h" |
27 #include "ppapi/c/ppp_instance.h" | 27 #include "ppapi/c/ppp_instance.h" |
28 #include "ppapi/c/ppp_messaging.h" | 28 #include "ppapi/c/ppp_messaging.h" |
29 #include "ppapi/c/ppp_mouse_lock.h" | 29 #include "ppapi/c/ppp_mouse_lock.h" |
30 #include "ppapi/c/private/pp_content_decryptor.h" | 30 #include "ppapi/c/private/pp_content_decryptor.h" |
31 #include "ppapi/c/private/ppp_instance_private.h" | 31 #include "ppapi/c/private/ppp_instance_private.h" |
32 #include "ppapi/shared_impl/ppapi_preferences.h" | |
32 #include "ppapi/shared_impl/ppb_input_event_shared.h" | 33 #include "ppapi/shared_impl/ppb_input_event_shared.h" |
33 #include "ppapi/shared_impl/ppb_url_util_shared.h" | 34 #include "ppapi/shared_impl/ppb_url_util_shared.h" |
34 #include "ppapi/shared_impl/ppb_view_shared.h" | 35 #include "ppapi/shared_impl/ppb_view_shared.h" |
35 #include "ppapi/shared_impl/ppp_instance_combined.h" | 36 #include "ppapi/shared_impl/ppp_instance_combined.h" |
36 #include "ppapi/shared_impl/resource.h" | 37 #include "ppapi/shared_impl/resource.h" |
37 #include "ppapi/shared_impl/scoped_pp_resource.h" | 38 #include "ppapi/shared_impl/scoped_pp_resource.h" |
38 #include "ppapi/shared_impl/time_conversion.h" | 39 #include "ppapi/shared_impl/time_conversion.h" |
39 #include "ppapi/shared_impl/var.h" | 40 #include "ppapi/shared_impl/var.h" |
40 #include "ppapi/thunk/enter.h" | 41 #include "ppapi/thunk/enter.h" |
41 #include "ppapi/thunk/ppb_buffer_api.h" | 42 #include "ppapi/thunk/ppb_buffer_api.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 #endif // defined(OS_MACOSX) | 90 #endif // defined(OS_MACOSX) |
90 | 91 |
91 #if defined(USE_SKIA) | 92 #if defined(USE_SKIA) |
92 #include "printing/metafile.h" | 93 #include "printing/metafile.h" |
93 #include "printing/metafile_skia_wrapper.h" | 94 #include "printing/metafile_skia_wrapper.h" |
94 #include "skia/ext/platform_device.h" | 95 #include "skia/ext/platform_device.h" |
95 #endif | 96 #endif |
96 | 97 |
97 #if defined(OS_WIN) | 98 #if defined(OS_WIN) |
98 #include "base/metrics/histogram.h" | 99 #include "base/metrics/histogram.h" |
100 #include "base/win/windows_version.h" | |
99 #include "skia/ext/platform_canvas.h" | 101 #include "skia/ext/platform_canvas.h" |
100 #include "ui/gfx/codec/jpeg_codec.h" | 102 #include "ui/gfx/codec/jpeg_codec.h" |
101 #include "ui/gfx/gdi_util.h" | 103 #include "ui/gfx/gdi_util.h" |
102 #endif | 104 #endif |
103 | 105 |
104 using base::StringPrintf; | 106 using base::StringPrintf; |
105 using ppapi::InputEventData; | 107 using ppapi::InputEventData; |
106 using ppapi::PpapiGlobals; | 108 using ppapi::PpapiGlobals; |
107 using ppapi::PPB_InputEvent_Shared; | 109 using ppapi::PPB_InputEvent_Shared; |
108 using ppapi::PPB_View_Shared; | 110 using ppapi::PPB_View_Shared; |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
537 const std::vector<std::string>& arg_names, | 539 const std::vector<std::string>& arg_names, |
538 const std::vector<std::string>& arg_values, | 540 const std::vector<std::string>& arg_values, |
539 const GURL& plugin_url, | 541 const GURL& plugin_url, |
540 bool full_frame) { | 542 bool full_frame) { |
541 container_ = container; | 543 container_ = container; |
542 plugin_url_ = plugin_url; | 544 plugin_url_ = plugin_url; |
543 full_frame_ = full_frame; | 545 full_frame_ = full_frame; |
544 | 546 |
545 container_->setIsAcceptingTouchEvents(IsAcceptingTouchEvents()); | 547 container_->setIsAcceptingTouchEvents(IsAcceptingTouchEvents()); |
546 | 548 |
549 #if defined(OS_WIN) | |
brettw
2012/08/27 22:19:28
Can you split this into a separate function?
| |
550 if (base::win::GetVersion() <= base::win::VERSION_XP) { | |
551 ::ppapi::Preferences prefs = delegate_->GetPreferences(); | |
552 bool needsgpu = false; | |
vangelis
2012/08/28 05:12:06
nit: according to chrome's variable naming convent
| |
553 | |
554 for (unsigned int i = 0; i < arg_names.size(); i++) { | |
brettw
2012/08/27 22:19:28
Use size_t since that's the type that vector.size(
| |
555 if (arg_names[i] == "wmode") { | |
556 if (arg_values[i] == "direct" || arg_values[i] == "gpu") | |
557 needsgpu = true; | |
558 break; | |
559 } | |
560 } | |
561 UMA_HISTOGRAM_ENUMERATION("Flash.UsesGPU", | |
brettw
2012/08/27 22:19:28
Can you add a comment here about what this histogr
| |
562 needsgpu * 2 + prefs.is_webgl_supported, 4); | |
vangelis
2012/08/28 05:12:06
Is this bool to int conversion pretty standard and
| |
563 } | |
564 #endif | |
565 | |
547 argn_ = arg_names; | 566 argn_ = arg_names; |
548 argv_ = arg_values; | 567 argv_ = arg_values; |
549 scoped_array<const char*> argn_array(StringVectorToArgArray(argn_)); | 568 scoped_array<const char*> argn_array(StringVectorToArgArray(argn_)); |
550 scoped_array<const char*> argv_array(StringVectorToArgArray(argv_)); | 569 scoped_array<const char*> argv_array(StringVectorToArgArray(argv_)); |
551 return PP_ToBool(instance_interface_->DidCreate(pp_instance(), | 570 return PP_ToBool(instance_interface_->DidCreate(pp_instance(), |
552 argn_.size(), | 571 argn_.size(), |
553 argn_array.get(), | 572 argn_array.get(), |
554 argv_array.get())); | 573 argv_array.get())); |
555 } | 574 } |
556 | 575 |
(...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2433 screen_size_for_fullscreen_ = gfx::Size(); | 2452 screen_size_for_fullscreen_ = gfx::Size(); |
2434 WebElement element = container_->element(); | 2453 WebElement element = container_->element(); |
2435 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2454 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
2436 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2455 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
2437 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2456 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
2438 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2457 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
2439 } | 2458 } |
2440 | 2459 |
2441 } // namespace ppapi | 2460 } // namespace ppapi |
2442 } // namespace webkit | 2461 } // namespace webkit |
OLD | NEW |