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 #ifndef CHROME_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef CHROME_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
6 #define CHROME_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 6 #define CHROME_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
7 | 7 |
| 8 #include <set> |
| 9 |
8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
9 #include "base/weak_ptr.h" | 11 #include "base/weak_ptr.h" |
10 #include "webkit/glue/plugins/pepper_plugin_delegate.h" | 12 #include "webkit/glue/plugins/pepper_plugin_delegate.h" |
11 | 13 |
12 class RenderView; | 14 class RenderView; |
13 | 15 |
| 16 namespace pepper { |
| 17 class PluginInstance; |
| 18 } |
| 19 |
14 class PepperPluginDelegateImpl | 20 class PepperPluginDelegateImpl |
15 : public pepper::PluginDelegate, | 21 : public pepper::PluginDelegate, |
16 public base::SupportsWeakPtr<PepperPluginDelegateImpl> { | 22 public base::SupportsWeakPtr<PepperPluginDelegateImpl> { |
17 public: | 23 public: |
18 explicit PepperPluginDelegateImpl(RenderView* render_view); | 24 explicit PepperPluginDelegateImpl(RenderView* render_view); |
19 | 25 |
| 26 // Called by RenderView to tell us about painting events, these two functions |
| 27 // just correspond to the DidInitiatePaint and DidFlushPaint in R.V.. |
| 28 void ViewInitiatedPaint(); |
| 29 void ViewFlushedPaint(); |
| 30 |
20 // pepper::PluginDelegate implementation. | 31 // pepper::PluginDelegate implementation. |
| 32 virtual void InstanceCreated(pepper::PluginInstance* instance); |
| 33 virtual void InstanceDeleted(pepper::PluginInstance* instance); |
21 virtual PlatformImage2D* CreateImage2D(int width, int height); | 34 virtual PlatformImage2D* CreateImage2D(int width, int height); |
22 | 35 |
23 private: | 36 private: |
24 // Pointer to the RenderView that owns us. | 37 // Pointer to the RenderView that owns us. |
25 RenderView* render_view_; | 38 RenderView* render_view_; |
26 | 39 |
| 40 std::set<pepper::PluginInstance*> active_instances_; |
| 41 |
27 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 42 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
28 }; | 43 }; |
29 | 44 |
30 #endif // CHROME_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 45 #endif // CHROME_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |