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 |
105 protected: | 112 protected: |
106 // This function operates as a regular IPC listener. Subclasses | 113 // This function operates as a regular IPC listener. Subclasses |
107 // overriding this should first delegate to this implementation. | 114 // overriding this should first delegate to this implementation. |
108 virtual bool OnMessageReceived(const IPC::Message& msg); | 115 virtual bool OnMessageReceived(const IPC::Message& msg); |
109 | 116 |
110 // Dispatches control messages to observers. | |
111 bool OnControlMessageReceived(const IPC::Message& msg); | |
112 | |
113 // The Widget expects to be returned valid route_id. | 117 // The Widget expects to be returned valid route_id. |
114 void OnCreateWidget(int opener_id, | 118 void OnCreateWidget(int opener_id, |
115 blink::WebPopupType popup_type, | 119 blink::WebPopupType popup_type, |
116 int* route_id, | 120 int* route_id, |
117 int* surface_id); | 121 int* surface_id); |
118 | 122 |
119 // The View expects to be returned a valid route_id different from its own. | 123 // The View expects to be returned a valid route_id different from its own. |
120 // We do not keep track of the newly created widget in MockRenderThread, | 124 // We do not keep track of the newly created widget in MockRenderThread, |
121 // so it must be cleaned up on its own. | 125 // so it must be cleaned up on its own. |
122 void OnCreateWindow( | 126 void OnCreateWindow( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // A list of message filters added to this thread. | 162 // A list of message filters added to this thread. |
159 std::vector<scoped_refptr<IPC::ChannelProxy::MessageFilter> > filters_; | 163 std::vector<scoped_refptr<IPC::ChannelProxy::MessageFilter> > filters_; |
160 | 164 |
161 // Observers to notify. | 165 // Observers to notify. |
162 ObserverList<RenderProcessObserver> observers_; | 166 ObserverList<RenderProcessObserver> observers_; |
163 }; | 167 }; |
164 | 168 |
165 } // namespace content | 169 } // namespace content |
166 | 170 |
167 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ | 171 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ |
OLD | NEW |