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_COMMON_NP_CHANNEL_BASE_H_ | 5 #ifndef CONTENT_COMMON_NP_CHANNEL_BASE_H_ |
6 #define CONTENT_COMMON_NP_CHANNEL_BASE_H_ | 6 #define CONTENT_COMMON_NP_CHANNEL_BASE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Returns the most recent NPChannelBase to have received a message | 93 // Returns the most recent NPChannelBase to have received a message |
94 // in this process. | 94 // in this process. |
95 static NPChannelBase* GetCurrentChannel(); | 95 static NPChannelBase* GetCurrentChannel(); |
96 | 96 |
97 static void CleanupChannels(); | 97 static void CleanupChannels(); |
98 | 98 |
99 // Returns the NPObjectBase object for the route id passed in. | 99 // Returns the NPObjectBase object for the route id passed in. |
100 // Returns NULL on failure. | 100 // Returns NULL on failure. |
101 NPObjectBase* GetNPObjectListenerForRoute(int route_id); | 101 NPObjectBase* GetNPObjectListenerForRoute(int route_id); |
102 | 102 |
| 103 // Returns the event that's set when a call to the renderer causes a modal |
| 104 // dialog to come up. The default implementation returns NULL. Derived |
| 105 // classes should override this method if this functionality is required. |
| 106 virtual base::WaitableEvent* GetModalDialogEvent( |
| 107 gfx::NativeViewId containing_window); |
| 108 |
103 protected: | 109 protected: |
104 typedef NPChannelBase* (*ChannelFactory)(); | 110 typedef NPChannelBase* (*ChannelFactory)(); |
105 | 111 |
106 friend class base::RefCountedThreadSafe<NPChannelBase>; | 112 friend class base::RefCountedThreadSafe<NPChannelBase>; |
107 | 113 |
108 virtual ~NPChannelBase(); | 114 virtual ~NPChannelBase(); |
109 | 115 |
110 // Returns a NPChannelBase derived object for the given channel name. | 116 // Returns a NPChannelBase derived object for the given channel name. |
111 // If an existing channel exists returns that object, otherwise creates a | 117 // If an existing channel exists returns that object, otherwise creates a |
112 // new one. Even though on creation the object is refcounted, each caller | 118 // new one. Even though on creation the object is refcounted, each caller |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // a result of a sync call from the renderer must unblock the renderer. We | 193 // a result of a sync call from the renderer must unblock the renderer. We |
188 // additionally have to do this for async messages from the renderer that | 194 // additionally have to do this for async messages from the renderer that |
189 // have the unblock flag set, since they could be followed by a sync message | 195 // have the unblock flag set, since they could be followed by a sync message |
190 // that won't get dispatched until the call to the renderer is complete. | 196 // that won't get dispatched until the call to the renderer is complete. |
191 bool send_unblocking_only_during_unblock_dispatch_; | 197 bool send_unblocking_only_during_unblock_dispatch_; |
192 | 198 |
193 DISALLOW_COPY_AND_ASSIGN(NPChannelBase); | 199 DISALLOW_COPY_AND_ASSIGN(NPChannelBase); |
194 }; | 200 }; |
195 | 201 |
196 #endif // CONTENT_COMMON_NP_CHANNEL_BASE_H_ | 202 #endif // CONTENT_COMMON_NP_CHANNEL_BASE_H_ |
OLD | NEW |