OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome_frame/chrome_frame_npapi_entrypoints.h" | 5 #include "chrome_frame/chrome_frame_npapi_entrypoints.h" |
6 #include "chrome_frame/chrome_frame_npapi.h" | 6 #include "chrome_frame/chrome_frame_npapi.h" |
7 | 7 |
8 #define NPAPI WINAPI | 8 #define NPAPI WINAPI |
9 | 9 |
10 // Plugin entry points. | 10 // Plugin entry points. |
(...skipping 19 matching lines...) Expand all Loading... | |
30 plugin_funcs->newstream = chrome_frame::NPP_NewStream; | 30 plugin_funcs->newstream = chrome_frame::NPP_NewStream; |
31 plugin_funcs->destroystream = chrome_frame::NPP_DestroyStream; | 31 plugin_funcs->destroystream = chrome_frame::NPP_DestroyStream; |
32 plugin_funcs->asfile = NULL; | 32 plugin_funcs->asfile = NULL; |
33 plugin_funcs->writeready = chrome_frame::NPP_WriteReady; | 33 plugin_funcs->writeready = chrome_frame::NPP_WriteReady; |
34 plugin_funcs->write = chrome_frame::NPP_Write; | 34 plugin_funcs->write = chrome_frame::NPP_Write; |
35 plugin_funcs->print = chrome_frame::NPP_Print; | 35 plugin_funcs->print = chrome_frame::NPP_Print; |
36 plugin_funcs->event = NULL; | 36 plugin_funcs->event = NULL; |
37 plugin_funcs->urlnotify = chrome_frame::NPP_URLNotify; | 37 plugin_funcs->urlnotify = chrome_frame::NPP_URLNotify; |
38 plugin_funcs->getvalue = chrome_frame::NPP_GetValue; | 38 plugin_funcs->getvalue = chrome_frame::NPP_GetValue; |
39 plugin_funcs->setvalue = chrome_frame::NPP_SetValue; | 39 plugin_funcs->setvalue = chrome_frame::NPP_SetValue; |
40 plugin_funcs->urlredirectnotify = chrome_frame::NPP_URLRedirectNotify; | |
40 return NPERR_NO_ERROR; | 41 return NPERR_NO_ERROR; |
41 } | 42 } |
42 | 43 |
43 void NPAPI NP_Shutdown() { | 44 void NPAPI NP_Shutdown() { |
44 DVLOG(1) << __FUNCTION__; | 45 DVLOG(1) << __FUNCTION__; |
45 | 46 |
46 npapi::UninitializeBrowserFunctions(); | 47 npapi::UninitializeBrowserFunctions(); |
47 | 48 |
48 _pAtlModule->Unlock(); // matches Lock() inside NP_Initialize | 49 _pAtlModule->Unlock(); // matches Lock() inside NP_Initialize |
49 | 50 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
187 if (plugin_instance) { | 188 if (plugin_instance) { |
188 plugin_instance->UrlNotify(url, reason, notifyData); | 189 plugin_instance->UrlNotify(url, reason, notifyData); |
189 } | 190 } |
190 } | 191 } |
191 | 192 |
192 void NPP_Print(NPP instance, NPPrint* print_info) { | 193 void NPP_Print(NPP instance, NPPrint* print_info) { |
193 ChromeFrameNPAPI* plugin_instance = | 194 ChromeFrameNPAPI* plugin_instance = |
194 ChromeFrameNPAPI::ChromeFrameInstanceFromPluginInstance(instance); | 195 ChromeFrameNPAPI::ChromeFrameInstanceFromPluginInstance(instance); |
195 | 196 |
196 if (plugin_instance == NULL) { | 197 if (plugin_instance == NULL) { |
197 NOTREACHED(); | 198 NOTREACHED() << "Failed to find plugin instance"; |
198 return; | 199 return; |
199 } | 200 } |
200 | 201 |
201 plugin_instance->Print(print_info); | 202 plugin_instance->Print(print_info); |
202 } | 203 } |
203 | 204 |
205 void NPP_URLRedirectNotify(NPP instance, const char* url, int status, | |
206 void* notify_data) { | |
207 ChromeFrameNPAPI* plugin_instance = | |
208 ChromeFrameNPAPI::ChromeFrameInstanceFromPluginInstance(instance); | |
209 | |
210 if (plugin_instance == NULL) { | |
211 NOTREACHED() << "Failed to find plugin instance"; | |
212 return; | |
amit
2011/01/12 21:50:48
if we don't get a valid instance then maybe we sho
ananta
2011/01/12 22:01:41
Done.
| |
213 } | |
214 plugin_instance->URLRedirectNotify(url, status, notify_data); | |
215 } | |
216 | |
204 } // namespace chrome_frame | 217 } // namespace chrome_frame |
OLD | NEW |