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.h" | 9 #include "base/message_loop.h" |
10 #include "ppapi/c/dev/ppp_scrollbar_dev.h" | 10 #include "ppapi/c/dev/ppp_scrollbar_dev.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 PP_Resource PPB_Scrollbar_Impl::Create(PP_Instance instance, | 39 PP_Resource PPB_Scrollbar_Impl::Create(PP_Instance instance, |
40 bool vertical) { | 40 bool vertical) { |
41 scoped_refptr<PPB_Scrollbar_Impl> scrollbar( | 41 scoped_refptr<PPB_Scrollbar_Impl> scrollbar( |
42 new PPB_Scrollbar_Impl(instance)); | 42 new PPB_Scrollbar_Impl(instance)); |
43 scrollbar->Init(vertical); | 43 scrollbar->Init(vertical); |
44 return scrollbar->GetReference(); | 44 return scrollbar->GetReference(); |
45 } | 45 } |
46 | 46 |
47 PPB_Scrollbar_Impl::PPB_Scrollbar_Impl(PP_Instance instance) | 47 PPB_Scrollbar_Impl::PPB_Scrollbar_Impl(PP_Instance instance) |
48 : PPB_Widget_Impl(instance), | 48 : PPB_Widget_Impl(instance), |
49 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { | 49 weak_ptr_factory_(this) { |
50 } | 50 } |
51 | 51 |
52 PPB_Scrollbar_Impl::~PPB_Scrollbar_Impl() { | 52 PPB_Scrollbar_Impl::~PPB_Scrollbar_Impl() { |
53 } | 53 } |
54 | 54 |
55 void PPB_Scrollbar_Impl::Init(bool vertical) { | 55 void PPB_Scrollbar_Impl::Init(bool vertical) { |
56 PluginInstance* plugin_instance = ResourceHelper::GetPluginInstance(this); | 56 PluginInstance* plugin_instance = ResourceHelper::GetPluginInstance(this); |
57 if (!plugin_instance) | 57 if (!plugin_instance) |
58 return; | 58 return; |
59 scrollbar_.reset(WebPluginScrollbar::createForPlugin( | 59 scrollbar_.reset(WebPluginScrollbar::createForPlugin( |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 pp_rect.point.x = dirty_.x(); | 241 pp_rect.point.x = dirty_.x(); |
242 pp_rect.point.y = dirty_.y(); | 242 pp_rect.point.y = dirty_.y(); |
243 pp_rect.size.width = dirty_.width(); | 243 pp_rect.size.width = dirty_.width(); |
244 pp_rect.size.height = dirty_.height(); | 244 pp_rect.size.height = dirty_.height(); |
245 dirty_ = gfx::Rect(); | 245 dirty_ = gfx::Rect(); |
246 Invalidate(&pp_rect); | 246 Invalidate(&pp_rect); |
247 } | 247 } |
248 | 248 |
249 } // namespace ppapi | 249 } // namespace ppapi |
250 } // namespace webkit | 250 } // namespace webkit |
OLD | NEW |