OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/plugins/pepper_scrollbar.h" | 5 #include "webkit/glue/plugins/pepper_scrollbar.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "third_party/ppapi/c/ppp_scrollbar.h" | 9 #include "third_party/ppapi/c/ppp_scrollbar.h" |
10 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 using WebKit::WebRect; | 21 using WebKit::WebRect; |
22 using WebKit::WebScrollbar; | 22 using WebKit::WebScrollbar; |
23 | 23 |
24 namespace pepper { | 24 namespace pepper { |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 PP_Resource Create(PP_Instance instance_id, bool vertical) { | 28 PP_Resource Create(PP_Instance instance_id, bool vertical) { |
29 PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); | 29 PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); |
30 if (!instance) | 30 if (!instance) |
31 return NULL; | 31 return 0; |
32 | 32 |
33 scoped_refptr<Scrollbar> scrollbar(new Scrollbar(instance, vertical)); | 33 scoped_refptr<Scrollbar> scrollbar(new Scrollbar(instance, vertical)); |
34 return scrollbar->GetReference(); | 34 return scrollbar->GetReference(); |
35 } | 35 } |
36 | 36 |
37 bool IsScrollbar(PP_Resource resource) { | 37 bool IsScrollbar(PP_Resource resource) { |
38 return !!Resource::GetAs<Scrollbar>(resource); | 38 return !!Resource::GetAs<Scrollbar>(resource); |
39 } | 39 } |
40 | 40 |
41 uint32_t GetThickness() { | 41 uint32_t GetThickness() { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 PP_Rect pp_rect; | 219 PP_Rect pp_rect; |
220 pp_rect.point.x = dirty_.x(); | 220 pp_rect.point.x = dirty_.x(); |
221 pp_rect.point.y = dirty_.y(); | 221 pp_rect.point.y = dirty_.y(); |
222 pp_rect.size.width = dirty_.width(); | 222 pp_rect.size.width = dirty_.width(); |
223 pp_rect.size.height = dirty_.height(); | 223 pp_rect.size.height = dirty_.height(); |
224 dirty_ = gfx::Rect(); | 224 dirty_ = gfx::Rect(); |
225 Invalidate(&pp_rect); | 225 Invalidate(&pp_rect); |
226 } | 226 } |
227 | 227 |
228 } // namespace pepper | 228 } // namespace pepper |
OLD | NEW |