| 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 "ppapi/cpp/dev/widget_dev.h" | 5 #include "ppapi/cpp/dev/widget_dev.h" |
| 6 | 6 |
| 7 #include "ppapi/c/dev/ppb_widget_dev.h" | 7 #include "ppapi/c/dev/ppb_widget_dev.h" |
| 8 #include "ppapi/cpp/common.h" |
| 8 #include "ppapi/cpp/image_data.h" | 9 #include "ppapi/cpp/image_data.h" |
| 9 #include "ppapi/cpp/instance.h" | 10 #include "ppapi/cpp/instance.h" |
| 10 #include "ppapi/cpp/module.h" | 11 #include "ppapi/cpp/module.h" |
| 11 #include "ppapi/cpp/rect.h" | 12 #include "ppapi/cpp/rect.h" |
| 12 #include "ppapi/cpp/module_impl.h" | 13 #include "ppapi/cpp/module_impl.h" |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 DeviceFuncs<PPB_Widget_Dev> widget_f(PPB_WIDGET_DEV_INTERFACE); | 17 DeviceFuncs<PPB_Widget_Dev> widget_f(PPB_WIDGET_DEV_INTERFACE); |
| 17 | 18 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 31 return *this; | 32 return *this; |
| 32 } | 33 } |
| 33 | 34 |
| 34 void Widget_Dev::swap(Widget_Dev& other) { | 35 void Widget_Dev::swap(Widget_Dev& other) { |
| 35 Resource::swap(other); | 36 Resource::swap(other); |
| 36 } | 37 } |
| 37 | 38 |
| 38 bool Widget_Dev::Paint(const Rect& rect, ImageData* image) { | 39 bool Widget_Dev::Paint(const Rect& rect, ImageData* image) { |
| 39 if (!widget_f) | 40 if (!widget_f) |
| 40 return false; | 41 return false; |
| 41 return widget_f->Paint( | 42 return PPBoolToBool(widget_f->Paint(pp_resource(), |
| 42 pp_resource(), &rect.pp_rect(), image->pp_resource()); | 43 &rect.pp_rect(), |
| 44 image->pp_resource())); |
| 43 } | 45 } |
| 44 | 46 |
| 45 bool Widget_Dev::HandleEvent(const PP_InputEvent& event) { | 47 bool Widget_Dev::HandleEvent(const PP_InputEvent& event) { |
| 46 if (!widget_f) | 48 if (!widget_f) |
| 47 return false; | 49 return false; |
| 48 return widget_f->HandleEvent(pp_resource(), &event); | 50 return PPBoolToBool(widget_f->HandleEvent(pp_resource(), &event)); |
| 49 } | 51 } |
| 50 | 52 |
| 51 bool Widget_Dev::GetLocation(Rect* location) { | 53 bool Widget_Dev::GetLocation(Rect* location) { |
| 52 if (!widget_f) | 54 if (!widget_f) |
| 53 return false; | 55 return false; |
| 54 return widget_f->GetLocation(pp_resource(), &location->pp_rect()); | 56 return PPBoolToBool(widget_f->GetLocation(pp_resource(), |
| 57 &location->pp_rect())); |
| 55 } | 58 } |
| 56 | 59 |
| 57 void Widget_Dev::SetLocation(const Rect& location) { | 60 void Widget_Dev::SetLocation(const Rect& location) { |
| 58 if (widget_f) | 61 if (widget_f) |
| 59 widget_f->SetLocation(pp_resource(), &location.pp_rect()); | 62 widget_f->SetLocation(pp_resource(), &location.pp_rect()); |
| 60 } | 63 } |
| 61 | 64 |
| 62 } // namespace pp | 65 } // namespace pp |
| OLD | NEW |