Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: content/public/renderer/render_view_observer.h

Issue 10532162: Rename IPC Sender and Listener in ppapi, content/public, and content/renderer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_VIEW_OBSERVER_H_ 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_VIEW_OBSERVER_H_
6 #define CONTENT_PUBLIC_RENDERER_RENDER_VIEW_OBSERVER_H_ 6 #define CONTENT_PUBLIC_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 "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "ipc/ipc_channel.h" 11 #include "ipc/ipc_listener.h"
12 #include "ipc/ipc_sender.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h" 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h"
13 14
14 class RenderViewImpl; 15 class RenderViewImpl;
15 16
16 namespace WebKit { 17 namespace WebKit {
17 class WebDataSource; 18 class WebDataSource;
18 class WebFrame; 19 class WebFrame;
19 class WebFormElement; 20 class WebFormElement;
20 class WebMediaPlayerClient; 21 class WebMediaPlayerClient;
21 class WebMouseEvent; 22 class WebMouseEvent;
22 class WebNode; 23 class WebNode;
23 class WebTouchEvent; 24 class WebTouchEvent;
24 class WebURL; 25 class WebURL;
25 struct WebURLError; 26 struct WebURLError;
26 } 27 }
27 28
28 namespace content { 29 namespace content {
29 30
30 class RenderView; 31 class RenderView;
31 32
32 // Base class for objects that want to filter incoming IPCs, and also get 33 // Base class for objects that want to filter incoming IPCs, and also get
33 // notified of changes to the frame. 34 // notified of changes to the frame.
34 class CONTENT_EXPORT RenderViewObserver : public IPC::Channel::Listener, 35 class CONTENT_EXPORT RenderViewObserver : public IPC::Listener,
35 public IPC::Message::Sender { 36 public IPC::Sender {
36 public: 37 public:
37 // By default, observers will be deleted when the RenderView goes away. If 38 // By default, observers will be deleted when the RenderView goes away. If
38 // they want to outlive it, they can override this function. 39 // they want to outlive it, they can override this function.
39 virtual void OnDestruct(); 40 virtual void OnDestruct();
40 41
41 // These match the WebKit API notifications 42 // These match the WebKit API notifications
42 virtual void DidStartLoading() {} 43 virtual void DidStartLoading() {}
43 virtual void DidStopLoading() {} 44 virtual void DidStopLoading() {}
44 virtual void DidChangeIcon(WebKit::WebFrame* frame, 45 virtual void DidChangeIcon(WebKit::WebFrame* frame,
45 WebKit::WebIconURL::Type) {} 46 WebKit::WebIconURL::Type) {}
(...skipping 29 matching lines...) Expand all
75 76
76 // These match the RenderView methods. 77 // These match the RenderView methods.
77 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) {} 78 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) {}
78 virtual void DidHandleTouchEvent(const WebKit::WebTouchEvent& event) {} 79 virtual void DidHandleTouchEvent(const WebKit::WebTouchEvent& event) {}
79 80
80 // These match incoming IPCs. 81 // These match incoming IPCs.
81 virtual void ContextMenuAction(unsigned id) {} 82 virtual void ContextMenuAction(unsigned id) {}
82 virtual void Navigate(const GURL& url) {} 83 virtual void Navigate(const GURL& url) {}
83 virtual void ClosePage() {} 84 virtual void ClosePage() {}
84 85
85 // IPC::Channel::Listener implementation. 86 // IPC::Listener implementation.
86 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 87 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
87 88
88 protected: 89 protected:
89 explicit RenderViewObserver(RenderView* render_view); 90 explicit RenderViewObserver(RenderView* render_view);
90 virtual ~RenderViewObserver(); 91 virtual ~RenderViewObserver();
91 92
92 // IPC::Message::Sender implementation. 93 // IPC::Sender implementation.
93 virtual bool Send(IPC::Message* message) OVERRIDE; 94 virtual bool Send(IPC::Message* message) OVERRIDE;
94 95
95 RenderView* render_view(); 96 RenderView* render_view();
96 int routing_id() { return routing_id_; } 97 int routing_id() { return routing_id_; }
97 98
98 private: 99 private:
99 friend class ::RenderViewImpl; 100 friend class ::RenderViewImpl;
100 101
101 // This is called by the RenderView when it's going away so that this object 102 // This is called by the RenderView when it's going away so that this object
102 // can null out its pointer. 103 // can null out its pointer.
103 void RenderViewGone(); 104 void RenderViewGone();
104 105
105 RenderView* render_view_; 106 RenderView* render_view_;
106 // The routing ID of the associated RenderView. 107 // The routing ID of the associated RenderView.
107 int routing_id_; 108 int routing_id_;
108 109
109 DISALLOW_COPY_AND_ASSIGN(RenderViewObserver); 110 DISALLOW_COPY_AND_ASSIGN(RenderViewObserver);
110 }; 111 };
111 112
112 } // namespace content 113 } // namespace content
113 114
114 #endif // CONTENT_PUBLIC_RENDERER_RENDER_VIEW_OBSERVER_H_ 115 #endif // CONTENT_PUBLIC_RENDERER_RENDER_VIEW_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698