| 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_widget.h" | 5 #include "webkit/glue/plugins/pepper_widget.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ppapi/c/dev/ppb_widget_dev.h" | 8 #include "ppapi/c/dev/ppb_widget_dev.h" |
| 9 #include "ppapi/c/dev/ppp_widget_dev.h" | 9 #include "ppapi/c/dev/ppp_widget_dev.h" |
| 10 #include "ppapi/c/pp_completion_callback.h" | 10 #include "ppapi/c/pp_completion_callback.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 Widget::~Widget() { | 68 Widget::~Widget() { |
| 69 } | 69 } |
| 70 | 70 |
| 71 // static | 71 // static |
| 72 const PPB_Widget_Dev* Widget::GetInterface() { | 72 const PPB_Widget_Dev* Widget::GetInterface() { |
| 73 return &ppb_widget; | 73 return &ppb_widget; |
| 74 } | 74 } |
| 75 | 75 |
| 76 Widget* Widget::AsWidget() { |
| 77 return this; |
| 78 } |
| 79 |
| 76 bool Widget::GetLocation(PP_Rect* location) { | 80 bool Widget::GetLocation(PP_Rect* location) { |
| 77 *location = location_; | 81 *location = location_; |
| 78 return true; | 82 return true; |
| 79 } | 83 } |
| 80 | 84 |
| 81 void Widget::SetLocation(const PP_Rect* location) { | 85 void Widget::SetLocation(const PP_Rect* location) { |
| 82 location_ = *location; | 86 location_ = *location; |
| 83 SetLocationInternal(location); | 87 SetLocationInternal(location); |
| 84 } | 88 } |
| 85 | 89 |
| 86 void Widget::Invalidate(const PP_Rect* dirty) { | 90 void Widget::Invalidate(const PP_Rect* dirty) { |
| 87 const PPP_Widget_Dev* widget = static_cast<const PPP_Widget_Dev*>( | 91 const PPP_Widget_Dev* widget = static_cast<const PPP_Widget_Dev*>( |
| 88 module()->GetPluginInterface(PPP_WIDGET_DEV_INTERFACE)); | 92 module()->GetPluginInterface(PPP_WIDGET_DEV_INTERFACE)); |
| 89 if (!widget) | 93 if (!widget) |
| 90 return; | 94 return; |
| 91 ScopedResourceId resource(this); | 95 ScopedResourceId resource(this); |
| 92 widget->Invalidate(instance_->pp_instance(), resource.id, dirty); | 96 widget->Invalidate(instance_->pp_instance(), resource.id, dirty); |
| 93 } | 97 } |
| 94 | 98 |
| 95 } // namespace pepper | 99 } // namespace pepper |
| OLD | NEW |