OLD | NEW |
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_TEST_MOCK_RENDER_THREAD_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ |
6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ | 6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ |
7 | 7 |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 void set_new_frame_routing_id(int32 id) { | 96 void set_new_frame_routing_id(int32 id) { |
97 new_frame_routing_id_ = id; | 97 new_frame_routing_id_ = id; |
98 } | 98 } |
99 | 99 |
100 // Simulates the Widget receiving a close message. This should result | 100 // Simulates the Widget receiving a close message. This should result |
101 // on releasing the internal reference counts and destroying the internal | 101 // on releasing the internal reference counts and destroying the internal |
102 // state. | 102 // state. |
103 void SendCloseMessage(); | 103 void SendCloseMessage(); |
104 | 104 |
105 // Dispatches control messages to observers. | |
106 bool OnControlMessageReceived(const IPC::Message& msg); | |
107 | |
108 ObserverList<RenderProcessObserver>& observers() { | |
109 return observers_; | |
110 } | |
111 | |
112 protected: | 105 protected: |
113 // This function operates as a regular IPC listener. Subclasses | 106 // This function operates as a regular IPC listener. Subclasses |
114 // overriding this should first delegate to this implementation. | 107 // overriding this should first delegate to this implementation. |
115 virtual bool OnMessageReceived(const IPC::Message& msg); | 108 virtual bool OnMessageReceived(const IPC::Message& msg); |
116 | 109 |
| 110 // Dispatches control messages to observers. |
| 111 bool OnControlMessageReceived(const IPC::Message& msg); |
| 112 |
117 // The Widget expects to be returned valid route_id. | 113 // The Widget expects to be returned valid route_id. |
118 void OnCreateWidget(int opener_id, | 114 void OnCreateWidget(int opener_id, |
119 blink::WebPopupType popup_type, | 115 blink::WebPopupType popup_type, |
120 int* route_id, | 116 int* route_id, |
121 int* surface_id); | 117 int* surface_id); |
122 | 118 |
123 // The View expects to be returned a valid route_id different from its own. | 119 // The View expects to be returned a valid route_id different from its own. |
124 // We do not keep track of the newly created widget in MockRenderThread, | 120 // We do not keep track of the newly created widget in MockRenderThread, |
125 // so it must be cleaned up on its own. | 121 // so it must be cleaned up on its own. |
126 void OnCreateWindow( | 122 void OnCreateWindow( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // A list of message filters added to this thread. | 158 // A list of message filters added to this thread. |
163 std::vector<scoped_refptr<IPC::ChannelProxy::MessageFilter> > filters_; | 159 std::vector<scoped_refptr<IPC::ChannelProxy::MessageFilter> > filters_; |
164 | 160 |
165 // Observers to notify. | 161 // Observers to notify. |
166 ObserverList<RenderProcessObserver> observers_; | 162 ObserverList<RenderProcessObserver> observers_; |
167 }; | 163 }; |
168 | 164 |
169 } // namespace content | 165 } // namespace content |
170 | 166 |
171 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ | 167 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ |
OLD | NEW |