| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "webkit/glue/plugins/webplugin_delegate_impl.h" | 5 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 // Helper object for patching the SetCursor API. | 65 // Helper object for patching the SetCursor API. |
| 66 base::LazyInstance<iat_patch::IATPatchFunction> g_iat_patch_set_cursor( | 66 base::LazyInstance<iat_patch::IATPatchFunction> g_iat_patch_set_cursor( |
| 67 base::LINKER_INITIALIZED); | 67 base::LINKER_INITIALIZED); |
| 68 | 68 |
| 69 } // namespace | 69 } // namespace |
| 70 | 70 |
| 71 WebPluginDelegate* WebPluginDelegate::Create( | 71 WebPluginDelegate* WebPluginDelegate::Create( |
| 72 const FilePath& filename, | 72 const FilePath& filename, |
| 73 const std::string& mime_type, | 73 const std::string& mime_type, |
| 74 gfx::NativeView containing_view) { | 74 gfx::PluginWindowHandle containing_view) { |
| 75 scoped_refptr<NPAPI::PluginLib> plugin = | 75 scoped_refptr<NPAPI::PluginLib> plugin = |
| 76 NPAPI::PluginLib::CreatePluginLib(filename); | 76 NPAPI::PluginLib::CreatePluginLib(filename); |
| 77 if (plugin.get() == NULL) | 77 if (plugin.get() == NULL) |
| 78 return NULL; | 78 return NULL; |
| 79 | 79 |
| 80 NPError err = plugin->NP_Initialize(); | 80 NPError err = plugin->NP_Initialize(); |
| 81 if (err != NPERR_NO_ERROR) | 81 if (err != NPERR_NO_ERROR) |
| 82 return NULL; | 82 return NULL; |
| 83 | 83 |
| 84 scoped_refptr<NPAPI::PluginInstance> instance = | 84 scoped_refptr<NPAPI::PluginInstance> instance = |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 int code, WPARAM wParam, LPARAM lParam) { | 133 int code, WPARAM wParam, LPARAM lParam) { |
| 134 if (g_current_plugin_instance) { | 134 if (g_current_plugin_instance) { |
| 135 g_current_plugin_instance->OnModalLoopEntered(); | 135 g_current_plugin_instance->OnModalLoopEntered(); |
| 136 } else { | 136 } else { |
| 137 NOTREACHED(); | 137 NOTREACHED(); |
| 138 } | 138 } |
| 139 return CallNextHookEx(NULL, code, wParam, lParam); | 139 return CallNextHookEx(NULL, code, wParam, lParam); |
| 140 } | 140 } |
| 141 | 141 |
| 142 WebPluginDelegateImpl::WebPluginDelegateImpl( | 142 WebPluginDelegateImpl::WebPluginDelegateImpl( |
| 143 gfx::NativeView containing_view, | 143 gfx::PluginWindowHandle containing_view, |
| 144 NPAPI::PluginInstance *instance) | 144 NPAPI::PluginInstance *instance) |
| 145 : parent_(containing_view), | 145 : parent_(containing_view), |
| 146 instance_(instance), | 146 instance_(instance), |
| 147 quirks_(0), | 147 quirks_(0), |
| 148 plugin_(NULL), | 148 plugin_(NULL), |
| 149 windowless_(false), | 149 windowless_(false), |
| 150 windowed_handle_(NULL), | 150 windowed_handle_(NULL), |
| 151 windowed_did_set_window_(false), | 151 windowed_did_set_window_(false), |
| 152 windowless_needs_set_window_(true), | 152 windowless_needs_set_window_(true), |
| 153 plugin_wnd_proc_(NULL), | 153 plugin_wnd_proc_(NULL), |
| (...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 | 1313 |
| 1314 // It is ok to pass NULL here to GetCursor as we are not looking for cursor | 1314 // It is ok to pass NULL here to GetCursor as we are not looking for cursor |
| 1315 // types defined by Webkit. | 1315 // types defined by Webkit. |
| 1316 HCURSOR previous_cursor = | 1316 HCURSOR previous_cursor = |
| 1317 g_current_plugin_instance->current_windowless_cursor_.GetCursor(NULL); | 1317 g_current_plugin_instance->current_windowless_cursor_.GetCursor(NULL); |
| 1318 | 1318 |
| 1319 g_current_plugin_instance->current_windowless_cursor_.InitFromExternalCursor( | 1319 g_current_plugin_instance->current_windowless_cursor_.InitFromExternalCursor( |
| 1320 cursor); | 1320 cursor); |
| 1321 return previous_cursor; | 1321 return previous_cursor; |
| 1322 } | 1322 } |
| OLD | NEW |