| 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" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h" |
| 11 | 12 |
| 12 class RenderView; | 13 class RenderView; |
| 13 | 14 |
| 14 namespace WebKit { | 15 namespace WebKit { |
| 15 class WebDataSource; | 16 class WebDataSource; |
| 16 class WebFrame; | 17 class WebFrame; |
| 17 class WebFormElement; | 18 class WebFormElement; |
| 18 class WebMediaPlayerClient; | 19 class WebMediaPlayerClient; |
| 19 class WebMouseEvent; | 20 class WebMouseEvent; |
| 20 class WebNode; | 21 class WebNode; |
| 21 class WebString; | 22 class WebString; |
| 22 class WebURL; | 23 class WebURL; |
| 23 struct WebURLError; | 24 struct WebURLError; |
| 24 } | 25 } |
| 25 | 26 |
| 26 // Base class for objects that want to filter incoming IPCs, and also get | 27 // Base class for objects that want to filter incoming IPCs, and also get |
| 27 // notified of changes to the frame. | 28 // notified of changes to the frame. |
| 28 class RenderViewObserver : public IPC::Channel::Listener, | 29 class RenderViewObserver : public IPC::Channel::Listener, |
| 29 public IPC::Message::Sender { | 30 public IPC::Message::Sender { |
| 30 public: | 31 public: |
| 31 // By default, observers will be deleted when the RenderView goes away. If | 32 // By default, observers will be deleted when the RenderView goes away. If |
| 32 // they want to outlive it, they can override this function. | 33 // they want to outlive it, they can override this function. |
| 33 virtual void OnDestruct(); | 34 virtual void OnDestruct(); |
| 34 | 35 |
| 35 // These match the WebKit API notifications | 36 // These match the WebKit API notifications |
| 36 virtual void DidStartLoading() {} | 37 virtual void DidStartLoading() {} |
| 37 virtual void DidStopLoading() {} | 38 virtual void DidStopLoading() {} |
| 38 virtual void DidChangeIcons(WebKit::WebFrame* frame) {} | 39 virtual void DidChangeIcon(WebKit::WebFrame* frame, |
| 40 WebKit::WebIconURL::Type) {} |
| 39 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) {} | 41 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) {} |
| 40 virtual void DidFailLoad(WebKit::WebFrame* frame, | 42 virtual void DidFailLoad(WebKit::WebFrame* frame, |
| 41 const WebKit::WebURLError& error) {} | 43 const WebKit::WebURLError& error) {} |
| 42 virtual void DidFinishLoad(WebKit::WebFrame* frame) {} | 44 virtual void DidFinishLoad(WebKit::WebFrame* frame) {} |
| 43 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame) {} | 45 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame) {} |
| 44 virtual void DidFailProvisionalLoad(WebKit::WebFrame* frame, | 46 virtual void DidFailProvisionalLoad(WebKit::WebFrame* frame, |
| 45 const WebKit::WebURLError& error) {} | 47 const WebKit::WebURLError& error) {} |
| 46 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, | 48 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, |
| 47 bool is_new_navigation) {} | 49 bool is_new_navigation) {} |
| 48 virtual void DidClearWindowObject(WebKit::WebFrame* frame) {} | 50 virtual void DidClearWindowObject(WebKit::WebFrame* frame) {} |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 void set_render_view(RenderView* rv) { render_view_ = rv; } | 95 void set_render_view(RenderView* rv) { render_view_ = rv; } |
| 94 | 96 |
| 95 RenderView* render_view_; | 97 RenderView* render_view_; |
| 96 // The routing ID of the associated RenderView. | 98 // The routing ID of the associated RenderView. |
| 97 int routing_id_; | 99 int routing_id_; |
| 98 | 100 |
| 99 DISALLOW_COPY_AND_ASSIGN(RenderViewObserver); | 101 DISALLOW_COPY_AND_ASSIGN(RenderViewObserver); |
| 100 }; | 102 }; |
| 101 | 103 |
| 102 #endif // CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ | 104 #endif // CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ |
| OLD | NEW |