OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ |
6 #define CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 19 matching lines...) Expand all Loading... | |
30 | 30 |
31 class RendererPpapiHost; | 31 class RendererPpapiHost; |
32 class RenderFrame; | 32 class RenderFrame; |
33 class RenderFrameImpl; | 33 class RenderFrameImpl; |
34 | 34 |
35 // Base class for objects that want to filter incoming IPCs, and also get | 35 // Base class for objects that want to filter incoming IPCs, and also get |
36 // notified of changes to the frame. | 36 // notified of changes to the frame. |
37 class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, | 37 class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, |
38 public IPC::Sender { | 38 public IPC::Sender { |
39 public: | 39 public: |
40 // By default, observers will be deleted when the RenderFrame goes away. If | 40 // Subclass can use this to delete itself. If it does not, the subclass must |
miu
2016/06/07 17:56:30
nit: s/Subclass/A subclass/
xjz
2016/06/07 18:08:54
Done.
| |
41 // they want to outlive it, they can override this function. | 41 // always null-check each call to render_frame() becase the RenderFrame can |
42 virtual void OnDestruct(); | 42 // go away at any time. |
43 virtual void OnDestruct() = 0; | |
43 | 44 |
44 // Called when a Pepper plugin is created. | 45 // Called when a Pepper plugin is created. |
45 virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {} | 46 virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {} |
46 | 47 |
47 // Called when a load is explicitly stopped by the user or browser. | 48 // Called when a load is explicitly stopped by the user or browser. |
48 virtual void OnStop() {} | 49 virtual void OnStop() {} |
49 | 50 |
50 // Called when the RenderFrame visiblity is changed. | 51 // Called when the RenderFrame visiblity is changed. |
51 virtual void WasHidden() {} | 52 virtual void WasHidden() {} |
52 virtual void WasShown() {} | 53 virtual void WasShown() {} |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 RenderFrame* render_frame_; | 145 RenderFrame* render_frame_; |
145 // The routing ID of the associated RenderFrame. | 146 // The routing ID of the associated RenderFrame. |
146 int routing_id_; | 147 int routing_id_; |
147 | 148 |
148 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); | 149 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); |
149 }; | 150 }; |
150 | 151 |
151 } // namespace content | 152 } // namespace content |
152 | 153 |
153 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ | 154 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ |
OLD | NEW |