| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_RENDERER_PEPPER_WIDGET_H_ | |
| 6 #define CHROME_RENDERER_PEPPER_WIDGET_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "third_party/npapi/bindings/npapi_extensions.h" | |
| 11 | |
| 12 class Graphics2DDeviceContext; | |
| 13 | |
| 14 // Every class that implements a Pepper widget derives from this. | |
| 15 class PepperWidget { | |
| 16 public: | |
| 17 static NPWidgetExtensions* GetWidgetExtensions(); | |
| 18 | |
| 19 PepperWidget(); | |
| 20 void Init(NPP instance, int id); | |
| 21 | |
| 22 // Called as a result of the corresponding Pepper functions. | |
| 23 virtual void Destroy() = 0; | |
| 24 virtual void Paint(Graphics2DDeviceContext* context, const NPRect& dirty) = 0; | |
| 25 virtual bool HandleEvent(const NPPepperEvent& event) = 0; | |
| 26 virtual void GetProperty(NPWidgetProperty property, void* value) = 0; | |
| 27 virtual void SetProperty(NPWidgetProperty property, void* value) = 0; | |
| 28 | |
| 29 protected: | |
| 30 virtual ~PepperWidget(); | |
| 31 | |
| 32 // Tells the plugin that a property changed. | |
| 33 void WidgetPropertyChanged(NPWidgetProperty property); | |
| 34 | |
| 35 private: | |
| 36 NPP instance_; | |
| 37 int id_; | |
| 38 | |
| 39 DISALLOW_COPY_AND_ASSIGN(PepperWidget); | |
| 40 }; | |
| 41 | |
| 42 #endif // CHROME_RENDERER_PEPPER_WIDGET_H_ | |
| OLD | NEW |