| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_RENDER_VIEW_OBSERVER_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ |
| 6 #define CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "ipc/ipc_channel.h" | 10 #include "ipc/ipc_channel.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Base class for objects that want to filter incoming IPCs, and also get | 26 // Base class for objects that want to filter incoming IPCs, and also get |
| 27 // notified of changes to the frame. | 27 // notified of changes to the frame. |
| 28 class RenderViewObserver : public IPC::Channel::Listener, | 28 class RenderViewObserver : public IPC::Channel::Listener, |
| 29 public IPC::Message::Sender { | 29 public IPC::Message::Sender { |
| 30 public: | 30 public: |
| 31 // By default, observers will be deleted when the RenderView goes away. If | 31 // By default, observers will be deleted when the RenderView goes away. If |
| 32 // they want to outlive it, they can override this function. | 32 // they want to outlive it, they can override this function. |
| 33 virtual void OnDestruct(); | 33 virtual void OnDestruct(); |
| 34 | 34 |
| 35 // Allows certain IPC messages to be sent while swapped out, in case they |
| 36 // are needed to keep the browser and renderer in a consistent state. |
| 37 virtual bool CanSendWhileSwappedOut(IPC::Message* message) { return false; } |
| 38 |
| 35 // These match the WebKit API notifications | 39 // These match the WebKit API notifications |
| 36 virtual void DidStartLoading() {} | 40 virtual void DidStartLoading() {} |
| 37 virtual void DidStopLoading() {} | 41 virtual void DidStopLoading() {} |
| 38 virtual void DidChangeIcons(WebKit::WebFrame* frame) {} | 42 virtual void DidChangeIcons(WebKit::WebFrame* frame) {} |
| 39 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) {} | 43 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) {} |
| 40 virtual void DidFailLoad(WebKit::WebFrame* frame, | 44 virtual void DidFailLoad(WebKit::WebFrame* frame, |
| 41 const WebKit::WebURLError& error) {} | 45 const WebKit::WebURLError& error) {} |
| 42 virtual void DidFinishLoad(WebKit::WebFrame* frame) {} | 46 virtual void DidFinishLoad(WebKit::WebFrame* frame) {} |
| 43 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame) {} | 47 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame) {} |
| 44 virtual void DidFailProvisionalLoad(WebKit::WebFrame* frame, | 48 virtual void DidFailProvisionalLoad(WebKit::WebFrame* frame, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 void set_render_view(RenderView* rv) { render_view_ = rv; } | 97 void set_render_view(RenderView* rv) { render_view_ = rv; } |
| 94 | 98 |
| 95 RenderView* render_view_; | 99 RenderView* render_view_; |
| 96 // The routing ID of the associated RenderView. | 100 // The routing ID of the associated RenderView. |
| 97 int routing_id_; | 101 int routing_id_; |
| 98 | 102 |
| 99 DISALLOW_COPY_AND_ASSIGN(RenderViewObserver); | 103 DISALLOW_COPY_AND_ASSIGN(RenderViewObserver); |
| 100 }; | 104 }; |
| 101 | 105 |
| 102 #endif // CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ | 106 #endif // CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ |
| OLD | NEW |