| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "ppapi/cpp/dev/scrollbar_dev.h" | 7 #include "ppapi/cpp/dev/scrollbar_dev.h" |
| 8 | 8 |
| 9 #include "ppapi/cpp/common.h" | |
| 10 #include "ppapi/cpp/instance.h" | 9 #include "ppapi/cpp/instance.h" |
| 11 #include "ppapi/cpp/module.h" | 10 #include "ppapi/cpp/module.h" |
| 12 #include "ppapi/cpp/module_impl.h" | 11 #include "ppapi/cpp/module_impl.h" |
| 13 #include "ppapi/cpp/rect.h" | 12 #include "ppapi/cpp/rect.h" |
| 14 | 13 |
| 15 namespace pp { | 14 namespace pp { |
| 16 | 15 |
| 17 namespace { | 16 namespace { |
| 18 | 17 |
| 19 template <> const char* interface_name<PPB_Scrollbar_Dev>() { | 18 template <> const char* interface_name<PPB_Scrollbar_Dev>() { |
| 20 return PPB_SCROLLBAR_DEV_INTERFACE; | 19 return PPB_SCROLLBAR_DEV_INTERFACE; |
| 21 } | 20 } |
| 22 | 21 |
| 23 } // namespace | 22 } // namespace |
| 24 | 23 |
| 25 Scrollbar_Dev::Scrollbar_Dev(PP_Resource resource) : Widget_Dev(resource) { | 24 Scrollbar_Dev::Scrollbar_Dev(PP_Resource resource) : Widget_Dev(resource) { |
| 26 } | 25 } |
| 27 | 26 |
| 28 Scrollbar_Dev::Scrollbar_Dev(const Instance& instance, bool vertical) { | 27 Scrollbar_Dev::Scrollbar_Dev(const Instance& instance, bool vertical) { |
| 29 if (!has_interface<PPB_Scrollbar_Dev>()) | 28 if (!has_interface<PPB_Scrollbar_Dev>()) |
| 30 return; | 29 return; |
| 31 PassRefFromConstructor(get_interface<PPB_Scrollbar_Dev>()->Create( | 30 PassRefFromConstructor(get_interface<PPB_Scrollbar_Dev>()->Create( |
| 32 instance.pp_instance(), BoolToPPBool(vertical))); | 31 instance.pp_instance(), PP_FromBool(vertical))); |
| 33 } | 32 } |
| 34 | 33 |
| 35 Scrollbar_Dev::Scrollbar_Dev(const Scrollbar_Dev& other) | 34 Scrollbar_Dev::Scrollbar_Dev(const Scrollbar_Dev& other) |
| 36 : Widget_Dev(other) { | 35 : Widget_Dev(other) { |
| 37 } | 36 } |
| 38 | 37 |
| 39 uint32_t Scrollbar_Dev::GetThickness() { | 38 uint32_t Scrollbar_Dev::GetThickness() { |
| 40 if (!has_interface<PPB_Scrollbar_Dev>()) | 39 if (!has_interface<PPB_Scrollbar_Dev>()) |
| 41 return 0; | 40 return 0; |
| 42 return get_interface<PPB_Scrollbar_Dev>()->GetThickness(); | 41 return get_interface<PPB_Scrollbar_Dev>()->GetThickness(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 72 } | 71 } |
| 73 | 72 |
| 74 void Scrollbar_Dev::ScrollBy(PP_ScrollBy_Dev unit, int32_t multiplier) { | 73 void Scrollbar_Dev::ScrollBy(PP_ScrollBy_Dev unit, int32_t multiplier) { |
| 75 if (has_interface<PPB_Scrollbar_Dev>()) | 74 if (has_interface<PPB_Scrollbar_Dev>()) |
| 76 get_interface<PPB_Scrollbar_Dev>()->ScrollBy(pp_resource(), | 75 get_interface<PPB_Scrollbar_Dev>()->ScrollBy(pp_resource(), |
| 77 unit, | 76 unit, |
| 78 multiplier); | 77 multiplier); |
| 79 } | 78 } |
| 80 | 79 |
| 81 } // namespace pp | 80 } // namespace pp |
| OLD | NEW |