Index: webkit/glue/plugins/webplugin_delegate_impl_win.cc |
diff --git a/webkit/plugins/npapi/webplugin_delegate_impl_win.cc b/webkit/glue/plugins/webplugin_delegate_impl_win.cc |
similarity index 98% |
rename from webkit/plugins/npapi/webplugin_delegate_impl_win.cc |
rename to webkit/glue/plugins/webplugin_delegate_impl_win.cc |
index 4739a9c9210458de6ddaca641bdc24f633c36a4d..e1acba1fb641b5b08c61b8c86e94269876f17c72 100644 |
--- a/webkit/plugins/npapi/webplugin_delegate_impl_win.cc |
+++ b/webkit/glue/plugins/webplugin_delegate_impl_win.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
+#include "webkit/glue/plugins/webplugin_delegate_impl.h" |
#include <map> |
#include <string> |
@@ -22,23 +22,20 @@ |
#include "base/win/windows_version.h" |
#include "skia/ext/platform_canvas.h" |
#include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" |
+#include "webkit/glue/plugins/default_plugin_shared.h" |
+#include "webkit/glue/plugins/plugin_constants_win.h" |
+#include "webkit/glue/plugins/plugin_instance.h" |
+#include "webkit/glue/plugins/plugin_lib.h" |
+#include "webkit/glue/plugins/plugin_list.h" |
+#include "webkit/glue/plugins/plugin_stream_url.h" |
+#include "webkit/glue/plugins/webplugin.h" |
#include "webkit/glue/webkit_glue.h" |
-#include "webkit/plugins/npapi/default_plugin_shared.h" |
-#include "webkit/plugins/npapi/plugin_constants_win.h" |
-#include "webkit/plugins/npapi/plugin_instance.h" |
-#include "webkit/plugins/npapi/plugin_lib.h" |
-#include "webkit/plugins/npapi/plugin_list.h" |
-#include "webkit/plugins/npapi/plugin_stream_url.h" |
-#include "webkit/plugins/npapi/webplugin.h" |
using WebKit::WebCursorInfo; |
using WebKit::WebKeyboardEvent; |
using WebKit::WebInputEvent; |
using WebKit::WebMouseEvent; |
-namespace webkit { |
-namespace npapi { |
- |
namespace { |
const wchar_t kWebPluginDelegateProperty[] = L"WebPluginDelegateProperty"; |
@@ -184,9 +181,12 @@ std::wstring GetKeyPath(HKEY key) { |
} // namespace |
bool WebPluginDelegateImpl::IsPluginDelegateWindow(HWND window) { |
- static const int kBufLen = 64; |
- wchar_t class_name[kBufLen]; |
- if (!GetClassNameW(window, class_name, kBufLen)) |
+ // We use a buffer that is one char longer than we need to detect cases where |
+ // kNativeWindowClassName is a prefix of the given window's class name. It |
+ // happens that GetClassNameW will just silently truncate the class name to |
+ // fit into the given buffer. |
+ wchar_t class_name[arraysize(kNativeWindowClassName) + 1]; |
+ if (!GetClassNameW(window, class_name, arraysize(class_name))) |
return false; |
return wcscmp(class_name, kNativeWindowClassName) == 0; |
} |
@@ -246,7 +246,7 @@ LRESULT CALLBACK WebPluginDelegateImpl::MouseHookProc( |
WebPluginDelegateImpl::WebPluginDelegateImpl( |
gfx::PluginWindowHandle containing_view, |
- PluginInstance *instance) |
+ NPAPI::PluginInstance *instance) |
: parent_(containing_view), |
instance_(instance), |
quirks_(0), |
@@ -527,7 +527,7 @@ bool WebPluginDelegateImpl::WindowedCreatePlugin() { |
// property. Use an atom so that other processes can access the name of |
// the plugin that this window is hosting |
if (instance_ != NULL) { |
- PluginLib* plugin_lib = instance()->plugin_lib(); |
+ NPAPI::PluginLib* plugin_lib = instance()->plugin_lib(); |
if (plugin_lib != NULL) { |
std::wstring plugin_name = plugin_lib->plugin_info().name; |
if (!plugin_name.empty()) { |
@@ -1408,6 +1408,3 @@ void WebPluginDelegateImpl::HandleCaptureForMessage(HWND window, |
break; |
} |
} |
- |
-} // namespace npapi |
-} // namespace webkit |