| 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/ppb_scrollbar_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_scrollbar_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "ppapi/c/dev/ppp_scrollbar_dev.h" | 10 #include "ppapi/c/dev/ppp_scrollbar_dev.h" |
| 11 #include "ppapi/thunk/thunk.h" | 11 #include "ppapi/thunk/thunk.h" |
| 12 #include "skia/ext/platform_canvas.h" | 12 #include "skia/ext/platform_canvas.h" |
| 13 #include "third_party/WebKit/public/platform/WebCanvas.h" | 13 #include "third_party/WebKit/public/platform/WebCanvas.h" |
| 14 #include "third_party/WebKit/public/platform/WebRect.h" | 14 #include "third_party/WebKit/public/platform/WebRect.h" |
| 15 #include "third_party/WebKit/public/platform/WebVector.h" | 15 #include "third_party/WebKit/public/platform/WebVector.h" |
| 16 #include "third_party/WebKit/public/web/WebInputEvent.h" | 16 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 17 #include "third_party/WebKit/public/web/WebPluginScrollbar.h" | 17 #include "third_party/WebKit/public/web/WebPluginScrollbar.h" |
| 18 #include "webkit/glue/webkit_glue.h" | 18 #include "webkit/glue/webkit_glue.h" |
| 19 #include "webkit/plugins/ppapi/common.h" | 19 #include "webkit/plugins/ppapi/common.h" |
| 20 #include "webkit/plugins/ppapi/event_conversion.h" | 20 #include "webkit/plugins/ppapi/event_conversion.h" |
| 21 #include "webkit/plugins/ppapi/plugin_module.h" | 21 #include "webkit/plugins/ppapi/plugin_module.h" |
| 22 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 22 #include "webkit/plugins/ppapi/ppapi_plugin_instance_impl.h" |
| 23 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" | 23 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
| 24 #include "webkit/plugins/ppapi/resource_helper.h" | 24 #include "webkit/plugins/ppapi/resource_helper.h" |
| 25 | 25 |
| 26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
| 27 #include "base/win/windows_version.h" | 27 #include "base/win/windows_version.h" |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 using ppapi::thunk::PPB_Scrollbar_API; | 30 using ppapi::thunk::PPB_Scrollbar_API; |
| 31 using WebKit::WebInputEvent; | 31 using WebKit::WebInputEvent; |
| 32 using WebKit::WebRect; | 32 using WebKit::WebRect; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 47 | 47 |
| 48 PPB_Scrollbar_Impl::PPB_Scrollbar_Impl(PP_Instance instance) | 48 PPB_Scrollbar_Impl::PPB_Scrollbar_Impl(PP_Instance instance) |
| 49 : PPB_Widget_Impl(instance), | 49 : PPB_Widget_Impl(instance), |
| 50 weak_ptr_factory_(this) { | 50 weak_ptr_factory_(this) { |
| 51 } | 51 } |
| 52 | 52 |
| 53 PPB_Scrollbar_Impl::~PPB_Scrollbar_Impl() { | 53 PPB_Scrollbar_Impl::~PPB_Scrollbar_Impl() { |
| 54 } | 54 } |
| 55 | 55 |
| 56 void PPB_Scrollbar_Impl::Init(bool vertical) { | 56 void PPB_Scrollbar_Impl::Init(bool vertical) { |
| 57 PluginInstance* plugin_instance = ResourceHelper::GetPluginInstance(this); | 57 PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); |
| 58 if (!plugin_instance) | 58 if (!plugin_instance) |
| 59 return; | 59 return; |
| 60 scrollbar_.reset(WebPluginScrollbar::createForPlugin( | 60 scrollbar_.reset(WebPluginScrollbar::createForPlugin( |
| 61 vertical ? WebScrollbar::Vertical : WebScrollbar::Horizontal, | 61 vertical ? WebScrollbar::Vertical : WebScrollbar::Horizontal, |
| 62 ResourceHelper::GetPluginInstance(this)->container(), | 62 ResourceHelper::GetPluginInstance(this)->container(), |
| 63 static_cast<WebKit::WebPluginScrollbarClient*>(this))); | 63 static_cast<WebKit::WebPluginScrollbarClient*>(this))); |
| 64 } | 64 } |
| 65 | 65 |
| 66 PPB_Scrollbar_API* PPB_Scrollbar_Impl::AsPPB_Scrollbar_API() { | 66 PPB_Scrollbar_API* PPB_Scrollbar_Impl::AsPPB_Scrollbar_API() { |
| 67 return this; | 67 return this; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 pp_rect.point.x = dirty_.x(); | 242 pp_rect.point.x = dirty_.x(); |
| 243 pp_rect.point.y = dirty_.y(); | 243 pp_rect.point.y = dirty_.y(); |
| 244 pp_rect.size.width = dirty_.width(); | 244 pp_rect.size.width = dirty_.width(); |
| 245 pp_rect.size.height = dirty_.height(); | 245 pp_rect.size.height = dirty_.height(); |
| 246 dirty_ = gfx::Rect(); | 246 dirty_ = gfx::Rect(); |
| 247 Invalidate(&pp_rect); | 247 Invalidate(&pp_rect); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace ppapi | 250 } // namespace ppapi |
| 251 } // namespace webkit | 251 } // namespace webkit |
| OLD | NEW |