diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 06:27:50 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 06:27:50 +0000 |
commit | 191eb3f7ee90f8ce1d1bee4a37f3acee0c10068c (patch) | |
tree | b982048e66a62646694c16c2cb10cb7ad30d8912 /webkit | |
parent | cfef856dd2ccece3cea13ccc96ac9579fd2b30b5 (diff) | |
download | chromium_src-191eb3f7ee90f8ce1d1bee4a37f3acee0c10068c.zip chromium_src-191eb3f7ee90f8ce1d1bee4a37f3acee0c10068c.tar.gz chromium_src-191eb3f7ee90f8ce1d1bee4a37f3acee0c10068c.tar.bz2 |
Re-land earlier patch that moves the NPAPI implementation from webkit/glue/plugins to webkit/plugins/npapi
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69808 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/plugin_constants_win.h | 41 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_list.h | 332 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_stubs.cc | 30 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.gypi | 146 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.h | 10 | ||||
-rw-r--r-- | webkit/glue/webkitclient_impl.cc | 10 | ||||
-rw-r--r-- | webkit/plugins/npapi/DEPS (renamed from webkit/glue/plugins/DEPS) | 2 | ||||
-rw-r--r-- | webkit/plugins/npapi/carbon_plugin_window_tracker_mac.cc (renamed from webkit/glue/plugins/carbon_plugin_window_tracker_mac.cc) | 9 | ||||
-rw-r--r-- | webkit/plugins/npapi/carbon_plugin_window_tracker_mac.h (renamed from webkit/glue/plugins/carbon_plugin_window_tracker_mac.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/coregraphics_private_symbols_mac.h (renamed from webkit/glue/plugins/coregraphics_private_symbols_mac.h) | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/default_plugin_shared.h (renamed from webkit/glue/plugins/default_plugin_shared.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/gtk_plugin_container.cc (renamed from webkit/glue/plugins/gtk_plugin_container.cc) | 10 | ||||
-rw-r--r-- | webkit/plugins/npapi/gtk_plugin_container.h (renamed from webkit/glue/plugins/gtk_plugin_container.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/gtk_plugin_container_manager.cc (renamed from webkit/glue/plugins/gtk_plugin_container_manager.cc) | 14 | ||||
-rw-r--r-- | webkit/plugins/npapi/gtk_plugin_container_manager.h (renamed from webkit/glue/plugins/gtk_plugin_container_manager.h) | 16 | ||||
-rw-r--r-- | webkit/plugins/npapi/npapi_extension_thunk.cc (renamed from webkit/glue/plugins/npapi_extension_thunk.cc) | 90 | ||||
-rw-r--r-- | webkit/plugins/npapi/npapi_extension_thunk.h (renamed from webkit/glue/plugins/npapi_extension_thunk.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_constants_win.cc | 28 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_constants_win.h | 45 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_group.cc (renamed from webkit/glue/plugins/plugin_group.cc) | 20 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_group.h (renamed from webkit/glue/plugins/plugin_group.h) | 24 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_group_unittest.cc (renamed from webkit/glue/plugins/plugin_group_unittest.cc) | 18 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_host.cc (renamed from webkit/glue/plugins/plugin_host.cc) | 127 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_host.h (renamed from webkit/glue/plugins/plugin_host.h) | 14 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_instance.cc (renamed from webkit/glue/plugins/plugin_instance.cc) | 29 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_instance.h (renamed from webkit/glue/plugins/plugin_instance.h) | 32 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_instance_mac.mm (renamed from webkit/glue/plugins/plugin_instance_mac.mm) | 13 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_lib.cc (renamed from webkit/glue/plugins/plugin_lib.cc) | 14 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_lib.h (renamed from webkit/glue/plugins/plugin_lib.h) | 16 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_lib_mac.mm (renamed from webkit/glue/plugins/plugin_lib_mac.mm) | 18 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_lib_posix.cc (renamed from webkit/glue/plugins/plugin_lib_posix.cc) | 17 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_lib_unittest.cc (renamed from webkit/glue/plugins/plugin_lib_unittest.cc) | 34 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_lib_win.cc (renamed from webkit/glue/plugins/plugin_lib_win.cc) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_list.cc (renamed from webkit/glue/plugins/plugin_list.cc) | 28 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_list.h | 339 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_list_mac.mm (renamed from webkit/glue/plugins/plugin_list_mac.mm) | 13 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_list_posix.cc (renamed from webkit/glue/plugins/plugin_list_posix.cc) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_list_win.cc (renamed from webkit/glue/plugins/plugin_list_win.cc) | 53 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_stream.cc (renamed from webkit/glue/plugins/plugin_stream.cc) | 14 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_stream.h (renamed from webkit/glue/plugins/plugin_stream.h) | 24 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_stream_posix.cc (renamed from webkit/glue/plugins/plugin_stream_posix.cc) | 10 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_stream_url.cc (renamed from webkit/glue/plugins/plugin_stream_url.cc) | 20 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_stream_url.h (renamed from webkit/glue/plugins/plugin_stream_url.h) | 21 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_stream_win.cc (renamed from webkit/glue/plugins/plugin_stream_win.cc) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_string_stream.cc (renamed from webkit/glue/plugins/plugin_string_stream.cc) | 10 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_string_stream.h (renamed from webkit/glue/plugins/plugin_string_stream.h) | 15 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_web_event_converter_mac.h (renamed from webkit/glue/plugins/plugin_web_event_converter_mac.h) | 14 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_web_event_converter_mac.mm (renamed from webkit/glue/plugins/plugin_web_event_converter_mac.mm) | 8 | ||||
-rw-r--r-- | webkit/plugins/npapi/quickdraw_drawing_manager_mac.cc (renamed from webkit/glue/plugins/quickdraw_drawing_manager_mac.cc) | 10 | ||||
-rw-r--r-- | webkit/plugins/npapi/quickdraw_drawing_manager_mac.h (renamed from webkit/glue/plugins/quickdraw_drawing_manager_mac.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/Info.plist (renamed from webkit/glue/plugins/test/Info.plist) | 0 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/npapi_constants.cc (renamed from webkit/glue/plugins/test/npapi_constants.cc) | 8 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/npapi_constants.h (renamed from webkit/glue/plugins/test/npapi_constants.h) | 13 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/npapi_test.cc (renamed from webkit/glue/plugins/test/npapi_test.cc) | 4 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/npapi_test.def (renamed from webkit/glue/plugins/test/npapi_test.def) | 0 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/npapi_test.rc (renamed from webkit/glue/plugins/test/npapi_test.rc) | 0 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_arguments_test.cc (renamed from webkit/glue/plugins/test/plugin_arguments_test.cc) | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_arguments_test.h (renamed from webkit/glue/plugins/test/plugin_arguments_test.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_client.cc (renamed from webkit/glue/plugins/test/plugin_client.cc) | 8 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_client.h (renamed from webkit/glue/plugins/test/plugin_client.h) | 10 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_create_instance_in_paint.cc (renamed from webkit/glue/plugins/test/plugin_create_instance_in_paint.cc) | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_create_instance_in_paint.h (renamed from webkit/glue/plugins/test/plugin_create_instance_in_paint.h) | 10 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_delete_plugin_in_stream_test.cc (renamed from webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.cc) | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_delete_plugin_in_stream_test.h (renamed from webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_get_javascript_url2_test.cc (renamed from webkit/glue/plugins/test/plugin_get_javascript_url2_test.cc) | 4 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_get_javascript_url2_test.h (renamed from webkit/glue/plugins/test/plugin_get_javascript_url2_test.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_get_javascript_url_test.cc (renamed from webkit/glue/plugins/test/plugin_get_javascript_url_test.cc) | 4 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_get_javascript_url_test.h (renamed from webkit/glue/plugins/test/plugin_get_javascript_url_test.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_geturl_test.cc (renamed from webkit/glue/plugins/test/plugin_geturl_test.cc) | 2 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_geturl_test.h (renamed from webkit/glue/plugins/test/plugin_geturl_test.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_javascript_open_popup.cc (renamed from webkit/glue/plugins/test/plugin_javascript_open_popup.cc) | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_javascript_open_popup.h (renamed from webkit/glue/plugins/test/plugin_javascript_open_popup.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_new_fails_test.cc (renamed from webkit/glue/plugins/test/plugin_new_fails_test.cc) | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_new_fails_test.h (renamed from webkit/glue/plugins/test/plugin_new_fails_test.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_npobject_lifetime_test.cc (renamed from webkit/glue/plugins/test/plugin_npobject_lifetime_test.cc) | 4 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_npobject_lifetime_test.h (renamed from webkit/glue/plugins/test/plugin_npobject_lifetime_test.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_npobject_proxy_test.cc (renamed from webkit/glue/plugins/test/plugin_npobject_proxy_test.cc) | 4 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_npobject_proxy_test.h (renamed from webkit/glue/plugins/test/plugin_npobject_proxy_test.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_private_test.cc (renamed from webkit/glue/plugins/test/plugin_private_test.cc) | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_private_test.h (renamed from webkit/glue/plugins/test/plugin_private_test.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_schedule_timer_test.cc (renamed from webkit/glue/plugins/test/plugin_schedule_timer_test.cc) | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_schedule_timer_test.h (renamed from webkit/glue/plugins/test/plugin_schedule_timer_test.h) | 8 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_setup_test.cc (renamed from webkit/glue/plugins/test/plugin_setup_test.cc) | 4 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_setup_test.h (renamed from webkit/glue/plugins/test/plugin_setup_test.h) | 10 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_test.cc (renamed from webkit/glue/plugins/test/plugin_test.cc) | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_test.h (renamed from webkit/glue/plugins/test/plugin_test.h) | 8 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_test_factory.cc (renamed from webkit/glue/plugins/test/plugin_test_factory.cc) | 34 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_test_factory.h (renamed from webkit/glue/plugins/test/plugin_test_factory.h) | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_thread_async_call_test.cc (renamed from webkit/glue/plugins/test/plugin_thread_async_call_test.cc) | 4 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_thread_async_call_test.h (renamed from webkit/glue/plugins/test/plugin_thread_async_call_test.h) | 8 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_window_size_test.cc (renamed from webkit/glue/plugins/test/plugin_window_size_test.cc) | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_window_size_test.h (renamed from webkit/glue/plugins/test/plugin_window_size_test.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_windowed_test.cc (renamed from webkit/glue/plugins/test/plugin_windowed_test.cc) | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_windowed_test.h (renamed from webkit/glue/plugins/test/plugin_windowed_test.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_windowless_test.cc (renamed from webkit/glue/plugins/test/plugin_windowless_test.cc) | 4 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/plugin_windowless_test.h (renamed from webkit/glue/plugins/test/plugin_windowless_test.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/resource.h (renamed from webkit/glue/plugins/test/resource.h) | 2 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin.cc (renamed from webkit/glue/plugins/webplugin.cc) | 8 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin.h (renamed from webkit/glue/plugins/webplugin.h) | 14 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_2d_device_delegate.cc (renamed from webkit/glue/plugins/webplugin_2d_device_delegate.cc) | 8 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_2d_device_delegate.h (renamed from webkit/glue/plugins/webplugin_2d_device_delegate.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_3d_device_delegate.cc (renamed from webkit/glue/plugins/webplugin_3d_device_delegate.cc) | 9 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_3d_device_delegate.h (renamed from webkit/glue/plugins/webplugin_3d_device_delegate.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_accelerated_surface_mac.h (renamed from webkit/glue/plugins/webplugin_accelerated_surface_mac.h) | 14 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_audio_device_delegate.cc (renamed from webkit/glue/plugins/webplugin_audio_device_delegate.cc) | 9 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_audio_device_delegate.h (renamed from webkit/glue/plugins/webplugin_audio_device_delegate.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate.cc (renamed from webkit/glue/plugins/webplugin_delegate.cc) | 9 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate.h (renamed from webkit/glue/plugins/webplugin_delegate.h) | 22 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl.cc (renamed from webkit/glue/plugins/webplugin_delegate_impl.cc) | 29 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl.h (renamed from webkit/glue/plugins/webplugin_delegate_impl.h) | 58 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc (renamed from webkit/glue/plugins/webplugin_delegate_impl_gtk.cc) | 26 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl_mac.mm (renamed from webkit/glue/plugins/webplugin_delegate_impl_mac.mm) | 46 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl_win.cc (renamed from webkit/glue/plugins/webplugin_delegate_impl_win.cc) | 35 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_file_delegate.cc (renamed from webkit/glue/plugins/webplugin_file_delegate.cc) | 8 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_file_delegate.h (renamed from webkit/glue/plugins/webplugin_file_delegate.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_impl.cc (renamed from webkit/glue/plugins/webplugin_impl.cc) | 19 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_impl.h (renamed from webkit/glue/plugins/webplugin_impl.h) | 17 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_impl_unittest.cc (renamed from webkit/glue/plugins/webplugin_impl_unittest.cc) | 20 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_page_delegate.h (renamed from webkit/glue/plugins/webplugin_page_delegate.h) | 14 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_print_delegate.cc (renamed from webkit/glue/plugins/webplugin_print_delegate.cc) | 8 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_print_delegate.h (renamed from webkit/glue/plugins/webplugin_print_delegate.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugininfo.cc (renamed from webkit/glue/plugins/webplugininfo.cc) | 8 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugininfo.h (renamed from webkit/glue/plugins/webplugininfo.h) | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/webview_plugin.cc (renamed from webkit/glue/plugins/webview_plugin.cc) | 8 | ||||
-rw-r--r-- | webkit/plugins/npapi/webview_plugin.h (renamed from webkit/glue/plugins/webview_plugin.h) | 20 | ||||
-rw-r--r-- | webkit/plugins/plugin_switches.cc | 6 | ||||
-rw-r--r-- | webkit/plugins/plugin_switches.h | 6 | ||||
-rw-r--r-- | webkit/plugins/ppapi/url_request_info_unittest.cc (renamed from webkit/glue/plugins/url_request_info_unittest.cc) | 0 | ||||
-rw-r--r-- | webkit/support/platform_support_mac.mm | 4 | ||||
-rw-r--r-- | webkit/support/test_webplugin_page_delegate.h | 14 | ||||
-rw-r--r-- | webkit/support/webkit_support.cc | 16 | ||||
-rw-r--r-- | webkit/support/webkit_support_glue.cc | 11 | ||||
-rw-r--r-- | webkit/tools/npapi_pepper_test_plugin/DEPS | 4 | ||||
-rw-r--r-- | webkit/tools/npapi_pepper_test_plugin/Info.plist | 46 | ||||
-rw-r--r-- | webkit/tools/npapi_pepper_test_plugin/main.cc | 64 | ||||
-rw-r--r-- | webkit/tools/npapi_pepper_test_plugin/pepper_3d_test.cc | 233 | ||||
-rw-r--r-- | webkit/tools/npapi_pepper_test_plugin/pepper_3d_test.h | 60 | ||||
-rw-r--r-- | webkit/tools/npapi_pepper_test_plugin/plugin.def | 6 | ||||
-rw-r--r-- | webkit/tools/npapi_pepper_test_plugin/plugin.rc | 29 | ||||
-rw-r--r-- | webkit/tools/npapi_pepper_test_plugin/test_factory.cc | 23 | ||||
-rw-r--r-- | webkit/tools/test_shell/mac/test_webview_delegate.mm | 11 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 27 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.gypi | 188 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_mac.mm | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.cc | 27 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 39 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate_gtk.cc | 17 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate_win.cc | 12 | ||||
-rw-r--r-- | webkit/tools/test_shell/webview_host.h | 6 | ||||
-rw-r--r-- | webkit/tools/test_shell/webview_host_gtk.cc | 2 |
150 files changed, 1651 insertions, 1900 deletions
diff --git a/webkit/glue/plugins/plugin_constants_win.h b/webkit/glue/plugins/plugin_constants_win.h deleted file mode 100644 index 9913e5d..0000000 --- a/webkit/glue/plugins/plugin_constants_win.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_GLUE_PLUGIN_CONSTANTS_WIN_H_ -#define WEBKIT_GLUE_PLUGIN_CONSTANTS_WIN_H_ - -// Used by the plugins_test when testing the older WMP plugin to force the new -// plugin to not get loaded. -#define kUseOldWMPPluginSwitch "use-old-wmp" - -// The window class name for a plugin window. -#define kNativeWindowClassName L"NativeWindowClass" - -// The name of the window class name for the wrapper HWND around the actual -// plugin window that's used when running in multi-process mode. This window -// is created on the browser UI thread. -#define kWrapperNativeWindowClassName L"WrapperNativeWindowClass" - -// The name of the custom window message that the browser uses to tell the -// plugin process to paint a window. -#define kPaintMessageName L"Chrome_CustomPaint" - -// The name of the registry key which NPAPI plugins update on installation. -#define kRegistryMozillaPlugins L"SOFTWARE\\MozillaPlugins" - -#define kMozillaActiveXPlugin L"npmozax.dll" -#define kNewWMPPlugin L"np-mswmp.dll" -#define kOldWMPPlugin L"npdsplay.dll" -#define kYahooApplicationStatePlugin L"npystate.dll" -#define kWanWangProtocolHandlerPlugin L"npww.dll" -#define kFlashPlugin L"npswf32.dll" -#define kAcrobatReaderPlugin L"nppdf32.dll" -#define kRealPlayerPlugin L"nppl3260.dll" -#define kSilverlightPlugin L"npctrl.dll" -#define kJavaPlugin1 L"npjp2.dll" -#define kJavaPlugin2 L"npdeploytk.dll" - -#define kGPUPluginMimeType "application/vnd.google.chrome.gpu-plugin" - -#endif // WEBKIT_GLUE_PLUGIN_PLUGIN_LIST_H_ diff --git a/webkit/glue/plugins/plugin_list.h b/webkit/glue/plugins/plugin_list.h index 734cc6d..111e8fa 100644 --- a/webkit/glue/plugins/plugin_list.h +++ b/webkit/glue/plugins/plugin_list.h @@ -5,332 +5,26 @@ #ifndef WEBKIT_GLUE_PLUGINS_PLUGIN_LIST_H_ #define WEBKIT_GLUE_PLUGINS_PLUGIN_LIST_H_ -#include <set> -#include <string> -#include <vector> +// This file is here to keep NativeClient compiling. PluginList was moved to +// webkit/plugins/npapi and into the webkit::npapi namespace. Native Client +// depends on this old location & namespace, so we provide just enough +// definitions here to keep it compiling until it can be updated to use the +// new location & namespace. +// +// TODO(brettw) remove this flie when NaCl is updated. -#include "base/basictypes.h" -#include "base/file_path.h" -#include "base/linked_ptr.h" -#include "base/lock.h" -#include "third_party/npapi/bindings/nphostapi.h" -#include "webkit/glue/plugins/plugin_group.h" -#include "webkit/glue/plugins/webplugininfo.h" - -class GURL; - -namespace base { - -template <typename T> -struct DefaultLazyInstanceTraits; - -} // namespace base +#include "webkit/plugins/npapi/plugin_list.h" namespace NPAPI { -#define kDefaultPluginLibraryName FILE_PATH_LITERAL("default_plugin") -#define kGearsPluginLibraryName FILE_PATH_LITERAL("gears") - -class PluginInstance; - -// This struct holds entry points into a plugin. The entry points are -// slightly different between Win/Mac and Unixes. -struct PluginEntryPoints { -#if !defined(OS_POSIX) || defined(OS_MACOSX) - NP_GetEntryPointsFunc np_getentrypoints; -#endif - NP_InitializeFunc np_initialize; - NP_ShutdownFunc np_shutdown; -}; - -// This struct fully describes a plugin. For external plugins, it's read in from -// the version info of the dll; For internal plugins, it's predefined and -// includes addresses of entry functions. (Yes, it's Win32 NPAPI-centric, but -// it'll do for holding descriptions of internal plugins cross-platform.) -struct PluginVersionInfo { - FilePath path; - // Info about the plugin itself. - std::wstring product_name; - std::wstring file_description; - std::wstring file_version; - // Info about the data types that the plugin supports. - std::wstring mime_types; - std::wstring file_extensions; - std::wstring type_descriptions; - // Entry points for internal plugins. Pointers are NULL for external plugins. - PluginEntryPoints entry_points; -}; +typedef webkit::npapi::PluginEntryPoints PluginEntryPoints; +typedef webkit::npapi::PluginVersionInfo PluginVersionInfo; -// The PluginList is responsible for loading our NPAPI based plugins. It does -// so in whatever manner is appropriate for the platform. On Windows, it loads -// plugins from a known directory by looking for DLLs which start with "NP", -// and checking to see if they are valid NPAPI libraries. On the Mac, it walks -// the machine-wide and user plugin directories and loads anything that has -// the correct types. On Linux, it walks the plugin directories as well -// (e.g. /usr/lib/browser-plugins/). -// This object is thread safe. class PluginList { public: - // Gets the one instance of the PluginList. - static PluginList* Singleton(); - - // Returns true if we're in debug-plugin-loading mode. This is controlled - // by a command line switch. - static bool DebugPluginLoading(); - - static const PluginGroupDefinition* GetPluginGroupDefinitions(); - static size_t GetPluginGroupDefinitionsSize(); - - // Returns true iff the plugin list has been loaded already. - bool PluginsLoaded(); - - // Cause the plugin list to refresh next time they are accessed, regardless - // of whether they are already loaded. - void RefreshPlugins(); - - // Add/Remove an extra plugin to load when we actually do the loading. Must - // be called before the plugins have been loaded. - void AddExtraPluginPath(const FilePath& plugin_path); - void RemoveExtraPluginPath(const FilePath& plugin_path); - - // Same as above, but specifies a directory in which to search for plugins. - void AddExtraPluginDir(const FilePath& plugin_dir); - - // Register an internal plugin with the specified plugin information and - // function pointers. An internal plugin must be registered before it can - // be loaded using PluginList::LoadPlugin(). - void RegisterInternalPlugin(const PluginVersionInfo& info); - - // Removes a specified internal plugin from the list. The search will match - // on the path from the version info previously registered. - // - // This is generally only necessary for tests. - void UnregisterInternalPlugin(const FilePath& path); - - // Creates a WebPluginInfo structure given a plugin's path. On success - // returns true, with the information being put into "info". If it's an - // internal plugin, "entry_points" is filled in as well with a - // internally-owned PluginEntryPoints pointer. - // Returns false if the library couldn't be found, or if it's not a plugin. - bool ReadPluginInfo(const FilePath& filename, - WebPluginInfo* info, - const PluginEntryPoints** entry_points); - - // Populate a WebPluginInfo from a PluginVersionInfo. - static bool CreateWebPluginInfo(const PluginVersionInfo& pvi, - WebPluginInfo* info); - - // Shutdown all plugins. Should be called at process teardown. - void Shutdown(); - - // Get all the plugins. - void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins); - - // Get all the enabled plugins. - void GetEnabledPlugins(bool refresh, std::vector<WebPluginInfo>* plugins); - - // Returns a list in |info| containing plugins that are found for - // the given url and mime type (including disabled plugins, for - // which |info->enabled| is false). The mime type which corresponds - // to the URL is optionally returned back in |actual_mime_types| (if - // it is non-NULL), one for each of the plugin info objects found. - // The |allow_wildcard| parameter controls whether this function - // returns plugins which support wildcard mime types (* as the mime - // type). The |info| parameter is required to be non-NULL. The - // list is in order of "most desirable" to "least desirable", - // meaning that the default plugin is at the end of the list. - void GetPluginInfoArray(const GURL& url, - const std::string& mime_type, - bool allow_wildcard, - std::vector<WebPluginInfo>* info, - std::vector<std::string>* actual_mime_types); - - // Returns the first item from the list returned in GetPluginInfo in |info|. - // Returns true if it found a match. |actual_mime_type| may be NULL. - bool GetPluginInfo(const GURL& url, - const std::string& mime_type, - bool allow_wildcard, - WebPluginInfo* info, - std::string* actual_mime_type); - - // Get plugin info by plugin path (including disabled plugins). Returns true - // if the plugin is found and WebPluginInfo has been filled in |info|. - bool GetPluginInfoByPath(const FilePath& plugin_path, - WebPluginInfo* info); - - // Populates the given vector with all available plugin groups. - void GetPluginGroups(bool load_if_necessary, - std::vector<PluginGroup>* plugin_groups); - - // Returns the PluginGroup corresponding to the given WebPluginInfo. If no - // such group exists, it is created and added to the cache. - // Beware: when calling this from the Browser process, the group that the - // returned pointer points to might disappear suddenly. This happens when - // |RefreshPlugins()| is called and then |LoadPlugins()| is triggered by a - // call to |GetPlugins()|, |GetEnabledPlugins()|, |GetPluginInfoArray()|, - // |GetPluginInfoByPath()|, or |GetPluginGroups(true, _)|. It is the caller's - // responsibility to make sure this doesn't happen. - const PluginGroup* GetPluginGroup(const WebPluginInfo& web_plugin_info); - - // Returns the name of the PluginGroup with the given identifier. - // If no such group exists, an empty string is returned. - string16 GetPluginGroupName(std::string identifier); - - // Returns the identifier string of the PluginGroup corresponding to the given - // WebPluginInfo. If no such group exists, it is created and added to the - // cache. - std::string GetPluginGroupIdentifier(const WebPluginInfo& web_plugin_info); - - // Load a specific plugin with full path. - void LoadPlugin(const FilePath& filename, - std::vector<WebPluginInfo>* plugins); - - // Enable a specific plugin, specified by path. Returns |true| iff a plugin - // currently in the plugin list was actually enabled as a result; regardless - // of return value, if a plugin is found in the future with the given name, it - // will be enabled. Note that plugins are enabled by default as far as - // |PluginList| is concerned. - bool EnablePlugin(const FilePath& filename); - - // Disable a specific plugin, specified by path. Returns |true| iff a plugin - // currently in the plugin list was actually disabled as a result; regardless - // of return value, if a plugin is found in the future with the given name, it - // will be disabled. - bool DisablePlugin(const FilePath& filename); - - // Enable/disable a plugin group, specified by group_name. Returns |true| iff - // a plugin currently in the plugin list was actually enabled/disabled as a - // result; regardless of return value, if a plugin is found in the future with - // the given name, it will be enabled/disabled. Note that plugins are enabled - // by default as far as |PluginList| is concerned. - bool EnableGroup(bool enable, const string16& name); - - // Disable all plugins groups that are known to be outdated, according to - // the information hardcoded in PluginGroup, to make sure that they can't - // be loaded on a web page and instead show a UI to update to the latest - // version. - void DisableOutdatedPluginGroups(); - - ~PluginList(); - - private: - FRIEND_TEST_ALL_PREFIXES(PluginGroupTest, PluginGroupDefinition); - - // Constructors are private for singletons - PluginList(); - - // Creates PluginGroups for the static group definitions, and adds them to - // the PluginGroup cache of this PluginList. - void AddHardcodedPluginGroups(); - - // Adds the given WebPluginInfo to its corresponding group, creating it if - // necessary, and returns the group. - // Callers need to protect calls to this method by a lock themselves. - PluginGroup* AddToPluginGroups(const WebPluginInfo& web_plugin_info); - - // Load all plugins from the default plugins directory - void LoadPlugins(bool refresh); - - // Load all plugins from a specific directory. - // |plugins| is updated with loaded plugin information. - // |visited_plugins| is updated with paths to all plugins that were considered - // (including those we didn't load) - void LoadPluginsFromDir(const FilePath& path, - std::vector<WebPluginInfo>* plugins, - std::set<FilePath>* visited_plugins); - - // Returns true if we should load the given plugin, or false otherwise. - // plugins is the list of plugins we have crawled in the current plugin - // loading run. - bool ShouldLoadPlugin(const WebPluginInfo& info, - std::vector<WebPluginInfo>* plugins); - - // Return whether a plug-in group with the given name should be disabled, - // either because it already is on the list of disabled groups, or because it - // is blacklisted by a policy. In the latter case, add the plugin group to the - // list of disabled groups as well. - bool ShouldDisableGroup(const string16& group_name); - - // Returns true if the given WebPluginInfo supports "mime-type". - // mime_type should be all lower case. - static bool SupportsType(const WebPluginInfo& info, - const std::string &mime_type, - bool allow_wildcard); - - // Returns true if the given WebPluginInfo supports a given file extension. - // extension should be all lower case. - // If mime_type is not NULL, it will be set to the mime type if found. - // The mime type which corresponds to the extension is optionally returned - // back. - static bool SupportsExtension(const WebPluginInfo& info, - const std::string &extension, - std::string* actual_mime_type); - - // - // Platform functions - // - - // Do any initialization. - void PlatformInit(); - - // Get the ordered list of directories from which to load plugins - void GetPluginDirectories(std::vector<FilePath>* plugin_dirs); - - // - // Command-line switches - // - -#if defined(OS_WIN) - // true if we shouldn't load the new WMP plugin. - bool dont_load_new_wmp_; - - // Loads plugins registered under HKCU\Software\MozillaPlugins and - // HKLM\Software\MozillaPlugins. - void LoadPluginsFromRegistry(std::vector<WebPluginInfo>* plugins, - std::set<FilePath>* visited_plugins); -#endif - - // - // Internals - // - - bool plugins_loaded_; - - // If true, we reload plugins even if they've been loaded already. - bool plugins_need_refresh_; - - // Contains information about the available plugins. - std::vector<WebPluginInfo> plugins_; - - // Extra plugin paths that we want to search when loading. - std::vector<FilePath> extra_plugin_paths_; - - // Extra plugin directories that we want to search when loading. - std::vector<FilePath> extra_plugin_dirs_; - - // Holds information about internal plugins. - std::vector<PluginVersionInfo> internal_plugins_; - - // Path names of plugins to disable (the default is to enable them all). - std::set<FilePath> disabled_plugins_; - - // Group names to disable (the default is to enable them all). - std::set<string16> disabled_groups_; - - bool disable_outdated_plugins_; - - // Holds the currently available plugin groups. - PluginGroup::PluginMap plugin_groups_; - - int next_priority_; - - // Need synchronization for the above members since this object can be - // accessed on multiple threads. - Lock lock_; - - friend struct base::DefaultLazyInstanceTraits<PluginList>; - - DISALLOW_COPY_AND_ASSIGN(PluginList); + static inline webkit::npapi::PluginList* Singleton() { + return webkit::npapi::PluginList::Singleton(); + } }; } // namespace NPAPI diff --git a/webkit/glue/plugins/plugin_stubs.cc b/webkit/glue/plugins/plugin_stubs.cc deleted file mode 100644 index f8210c30..0000000 --- a/webkit/glue/plugins/plugin_stubs.cc +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file stubs out some functions needed to make the linker happy -// without linking in all the plugin code. It should be removed once -// we have plugins working on all platforms. - -// TODO(port): remove this file. - -#include "base/logging.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/plugin_stream.h" - -namespace NPAPI { - -PluginStream::~PluginStream() { - NOTIMPLEMENTED(); -} - -bool PluginStream::Close(NPReason reason) { - NOTIMPLEMENTED(); - return false; -} - -void PluginInstance::NPP_StreamAsFile(NPStream*, const char*) { - NOTIMPLEMENTED(); -} - -} // namespace NPAPI diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi index 1499a6f..b45bf85 100644 --- a/webkit/glue/webkit_glue.gypi +++ b/webkit/glue/webkit_glue.gypi @@ -168,6 +168,75 @@ # This list contains all .h, .cc, and .mm files in glue except for # those in the test subdirectory and those with unittest in in their # names. + '../plugins/npapi/carbon_plugin_window_tracker_mac.cc', + '../plugins/npapi/carbon_plugin_window_tracker_mac.h', + '../plugins/npapi/coregraphics_private_symbols_mac.h', + '../plugins/npapi/default_plugin_shared.h', + '../plugins/npapi/gtk_plugin_container.cc', + '../plugins/npapi/gtk_plugin_container.h', + '../plugins/npapi/gtk_plugin_container_manager.cc', + '../plugins/npapi/gtk_plugin_container_manager.h', + '../plugins/npapi/npapi_extension_thunk.cc', + '../plugins/npapi/npapi_extension_thunk.h', + '../plugins/npapi/nphostapi.h', + '../plugins/npapi/plugin_constants_win.cc', + '../plugins/npapi/plugin_constants_win.h', + '../plugins/npapi/plugin_group.cc', + '../plugins/npapi/plugin_group.h', + '../plugins/npapi/plugin_host.cc', + '../plugins/npapi/plugin_host.h', + '../plugins/npapi/plugin_instance.cc', + '../plugins/npapi/plugin_instance.h', + '../plugins/npapi/plugin_instance_mac.mm', + '../plugins/npapi/plugin_lib.cc', + '../plugins/npapi/plugin_lib.h', + '../plugins/npapi/plugin_lib_mac.mm', + '../plugins/npapi/plugin_lib_posix.cc', + '../plugins/npapi/plugin_lib_win.cc', + '../plugins/npapi/plugin_list.cc', + '../plugins/npapi/plugin_list.h', + '../plugins/npapi/plugin_list_mac.mm', + '../plugins/npapi/plugin_list_posix.cc', + '../plugins/npapi/plugin_list_win.cc', + '../plugins/npapi/plugin_stream.cc', + '../plugins/npapi/plugin_stream.h', + '../plugins/npapi/plugin_stream_posix.cc', + '../plugins/npapi/plugin_stream_url.cc', + '../plugins/npapi/plugin_stream_url.h', + '../plugins/npapi/plugin_stream_win.cc', + '../plugins/npapi/plugin_string_stream.cc', + '../plugins/npapi/plugin_string_stream.h', + '../plugins/npapi/plugin_web_event_converter_mac.h', + '../plugins/npapi/plugin_web_event_converter_mac.mm', + '../plugins/npapi/ppb_private.h', + '../plugins/npapi/quickdraw_drawing_manager_mac.cc', + '../plugins/npapi/quickdraw_drawing_manager_mac.h', + '../plugins/npapi/webplugin.cc', + '../plugins/npapi/webplugin.h', + '../plugins/npapi/webplugin_2d_device_delegate.cc', + '../plugins/npapi/webplugin_2d_device_delegate.h', + '../plugins/npapi/webplugin_3d_device_delegate.cc', + '../plugins/npapi/webplugin_3d_device_delegate.h', + '../plugins/npapi/webplugin_accelerated_surface_mac.h', + '../plugins/npapi/webplugin_audio_device_delegate.cc', + '../plugins/npapi/webplugin_audio_device_delegate.h', + '../plugins/npapi/webplugin_delegate.cc', + '../plugins/npapi/webplugin_delegate.h', + '../plugins/npapi/webplugin_delegate_impl.cc', + '../plugins/npapi/webplugin_delegate_impl.h', + '../plugins/npapi/webplugin_delegate_impl_gtk.cc', + '../plugins/npapi/webplugin_delegate_impl_mac.mm', + '../plugins/npapi/webplugin_delegate_impl_win.cc', + '../plugins/npapi/webplugin_file_delegate.cc', + '../plugins/npapi/webplugin_file_delegate.h', + '../plugins/npapi/webplugin_impl.cc', + '../plugins/npapi/webplugin_impl.h', + '../plugins/npapi/webplugin_print_delegate.cc', + '../plugins/npapi/webplugin_print_delegate.h', + '../plugins/npapi/webplugininfo.cc', + '../plugins/npapi/webplugininfo.h', + '../plugins/npapi/webview_plugin.cc', + '../plugins/npapi/webview_plugin.h', '../plugins/plugin_switches.cc', '../plugins/plugin_switches.h', '../plugins/ppapi/callbacks.cc', @@ -184,14 +253,14 @@ '../plugins/ppapi/npapi_glue.cc', '../plugins/ppapi/npapi_glue.h', '../plugins/ppapi/plugin_delegate.h', - '../plugins/ppapi/ppapi_plugin_instance.cc', - '../plugins/ppapi/ppapi_plugin_instance.h', - '../plugins/ppapi/ppapi_webplugin_impl.cc', - '../plugins/ppapi/ppapi_webplugin_impl.h', '../plugins/ppapi/plugin_module.cc', '../plugins/ppapi/plugin_module.h', '../plugins/ppapi/plugin_object.cc', '../plugins/ppapi/plugin_object.h', + '../plugins/ppapi/ppapi_plugin_instance.cc', + '../plugins/ppapi/ppapi_plugin_instance.h', + '../plugins/ppapi/ppapi_webplugin_impl.cc', + '../plugins/ppapi/ppapi_webplugin_impl.h', '../plugins/ppapi/ppb_audio_impl.cc', '../plugins/ppapi/ppb_audio_impl.h', '../plugins/ppapi/ppb_buffer_impl.cc', @@ -267,75 +336,6 @@ 'media/web_data_source.cc', 'media/web_data_source.h', 'media/web_video_renderer.h', - 'plugins/carbon_plugin_window_tracker_mac.h', - 'plugins/carbon_plugin_window_tracker_mac.cc', - 'plugins/coregraphics_private_symbols_mac.h', - 'plugins/default_plugin_shared.h', - 'plugins/nphostapi.h', - 'plugins/gtk_plugin_container.h', - 'plugins/gtk_plugin_container.cc', - 'plugins/gtk_plugin_container_manager.h', - 'plugins/gtk_plugin_container_manager.cc', - 'plugins/npapi_extension_thunk.cc', - 'plugins/npapi_extension_thunk.h', - 'plugins/plugin_constants_win.h', - 'plugins/plugin_group.cc', - 'plugins/plugin_group.h', - 'plugins/plugin_host.cc', - 'plugins/plugin_host.h', - 'plugins/plugin_instance.cc', - 'plugins/plugin_instance.h', - 'plugins/plugin_instance_mac.mm', - 'plugins/plugin_lib.cc', - 'plugins/plugin_lib.h', - 'plugins/plugin_lib_mac.mm', - 'plugins/plugin_lib_posix.cc', - 'plugins/plugin_lib_win.cc', - 'plugins/plugin_list.cc', - 'plugins/plugin_list.h', - 'plugins/plugin_list_mac.mm', - 'plugins/plugin_list_posix.cc', - 'plugins/plugin_list_win.cc', - 'plugins/plugin_stream.cc', - 'plugins/plugin_stream.h', - 'plugins/plugin_stream_posix.cc', - 'plugins/plugin_stream_url.cc', - 'plugins/plugin_stream_url.h', - 'plugins/plugin_stream_win.cc', - 'plugins/plugin_string_stream.cc', - 'plugins/plugin_string_stream.h', - 'plugins/plugin_stubs.cc', - 'plugins/plugin_web_event_converter_mac.h', - 'plugins/plugin_web_event_converter_mac.mm', - 'plugins/ppb_private.h', - 'plugins/quickdraw_drawing_manager_mac.h', - 'plugins/quickdraw_drawing_manager_mac.cc', - 'plugins/webview_plugin.cc', - 'plugins/webview_plugin.h', - 'plugins/webplugin.cc', - 'plugins/webplugin.h', - 'plugins/webplugin_audio_device_delegate.cc', - 'plugins/webplugin_audio_device_delegate.h', - 'plugins/webplugin_2d_device_delegate.cc', - 'plugins/webplugin_2d_device_delegate.h', - 'plugins/webplugin_3d_device_delegate.cc', - 'plugins/webplugin_3d_device_delegate.h', - 'plugins/webplugin_accelerated_surface_mac.h', - 'plugins/webplugin_delegate.cc', - 'plugins/webplugin_delegate.h', - 'plugins/webplugin_delegate_impl.cc', - 'plugins/webplugin_delegate_impl.h', - 'plugins/webplugin_delegate_impl_gtk.cc', - 'plugins/webplugin_delegate_impl_mac.mm', - 'plugins/webplugin_delegate_impl_win.cc', - 'plugins/webplugin_file_delegate.cc', - 'plugins/webplugin_file_delegate.h', - 'plugins/webplugin_impl.cc', - 'plugins/webplugin_impl.h', - 'plugins/webplugin_print_delegate.cc', - 'plugins/webplugin_print_delegate.h', - 'plugins/webplugininfo.cc', - 'plugins/webplugininfo.h', 'alt_error_page_resource_fetcher.cc', 'alt_error_page_resource_fetcher.h', 'context_menu.cc', diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h index fbb541a..38ea659 100644 --- a/webkit/glue/webkit_glue.h +++ b/webkit/glue/webkit_glue.h @@ -23,7 +23,6 @@ class GURL; class SkBitmap; -struct WebPluginInfo; namespace base { class StringPiece; @@ -39,6 +38,12 @@ class WebString; class WebView; } +namespace webkit { +namespace npapi { +struct WebPluginInfo; +} +} + namespace webkit_glue { @@ -225,7 +230,8 @@ bool GetApplicationDirectory(FilePath* path); bool GetExeDirectory(FilePath* path); // Embedders implement this function to return the list of plugins to Webkit. -void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins); +void GetPlugins(bool refresh, + std::vector<webkit::npapi::WebPluginInfo>* plugins); // Returns true if the plugins run in the same process as the renderer, and // false otherwise. diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc index 5346181..844aae7 100644 --- a/webkit/glue/webkitclient_impl.cc +++ b/webkit/glue/webkitclient_impl.cc @@ -35,8 +35,8 @@ #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" #include "webkit/glue/media/audio_decoder.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/webplugininfo.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/webplugininfo.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/websocketstreamhandle_impl.h" #include "webkit/glue/weburlloader_impl.h" @@ -225,18 +225,18 @@ WebString WebKitClientImpl::userAgent(const WebURL& url) { void WebKitClientImpl::getPluginList(bool refresh, WebPluginListBuilder* builder) { - std::vector<WebPluginInfo> plugins; + std::vector<webkit::npapi::WebPluginInfo> plugins; GetPlugins(refresh, &plugins); for (size_t i = 0; i < plugins.size(); ++i) { - const WebPluginInfo& plugin = plugins[i]; + const webkit::npapi::WebPluginInfo& plugin = plugins[i]; builder->addPlugin( plugin.name, plugin.desc, FilePathStringToWebString(plugin.path.BaseName().value())); for (size_t j = 0; j < plugin.mime_types.size(); ++j) { - const WebPluginMimeType& mime_type = plugin.mime_types[j]; + const webkit::npapi::WebPluginMimeType& mime_type = plugin.mime_types[j]; builder->addMediaTypeToLastPlugin( WebString::fromUTF8(mime_type.mime_type), mime_type.description); diff --git a/webkit/glue/plugins/DEPS b/webkit/plugins/npapi/DEPS index 024a4ef..c3cbc8c 100644 --- a/webkit/glue/plugins/DEPS +++ b/webkit/plugins/npapi/DEPS @@ -1,4 +1,5 @@ include_rules = [ + "+app", "+ppapi", # Files in this directory must not depend on the proxy, because the proxy @@ -6,4 +7,5 @@ include_rules = [ "-ppapi/proxy", "+printing", + "+skia", ] diff --git a/webkit/glue/plugins/carbon_plugin_window_tracker_mac.cc b/webkit/plugins/npapi/carbon_plugin_window_tracker_mac.cc index c4ae72d..d652c9c 100644 --- a/webkit/glue/plugins/carbon_plugin_window_tracker_mac.cc +++ b/webkit/plugins/npapi/carbon_plugin_window_tracker_mac.cc @@ -2,8 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "webkit/plugins/npapi/carbon_plugin_window_tracker_mac.h" + #include "base/logging.h" -#include "webkit/glue/plugins/carbon_plugin_window_tracker_mac.h" + +namespace webkit { +namespace npapi { CarbonPluginWindowTracker::CarbonPluginWindowTracker() { } @@ -53,3 +57,6 @@ void CarbonPluginWindowTracker::DestroyDummyWindowForDelegate( if (window) // Check just in case the initial window creation failed. DisposeWindow(window); } + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/carbon_plugin_window_tracker_mac.h b/webkit/plugins/npapi/carbon_plugin_window_tracker_mac.h index 90fc318..65d12c8 100644 --- a/webkit/glue/plugins/carbon_plugin_window_tracker_mac.h +++ b/webkit/plugins/npapi/carbon_plugin_window_tracker_mac.h @@ -2,14 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_CARBON_PLUGIN_WINDOW_TRACKER_MAC_H_ -#define WEBKIT_GLUE_PLUGINS_CARBON_PLUGIN_WINDOW_TRACKER_MAC_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_CARBON_PLUGIN_WINDOW_TRACKER_MAC_H_ +#define WEBKIT_PLUGINS_NPAPI_CARBON_PLUGIN_WINDOW_TRACKER_MAC_H_ #include <Carbon/Carbon.h> #include <map> #include "base/basictypes.h" +namespace webkit { +namespace npapi { + // This is really a WebPluginDelegateImpl, but that class is private to the // framework, and these functions are called from a dylib. typedef void* OpaquePluginRef; @@ -50,4 +53,7 @@ class __attribute__((visibility("default"))) CarbonPluginWindowTracker { DISALLOW_COPY_AND_ASSIGN(CarbonPluginWindowTracker); }; -#endif // WEBKIT_GLUE_PLUGINS_CARBON_PLUGIN_WINDOW_TRACKER_MAC_H_ +} // namespace npapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_NPAPI_CARBON_PLUGIN_WINDOW_TRACKER_MAC_H_ diff --git a/webkit/glue/plugins/coregraphics_private_symbols_mac.h b/webkit/plugins/npapi/coregraphics_private_symbols_mac.h index 0342d6f..b51153f 100644 --- a/webkit/glue/plugins/coregraphics_private_symbols_mac.h +++ b/webkit/plugins/npapi/coregraphics_private_symbols_mac.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_COREGRAPHICS_PRIVATE_SYMBOLS_MAC_H_ -#define WEBKIT_GLUE_PLUGINS_COREGRAPHICS_PRIVATE_SYMBOLS_MAC_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_COREGRAPHICS_PRIVATE_SYMBOLS_MAC_H_ +#define WEBKIT_PLUGINS_NPAPI_COREGRAPHICS_PRIVATE_SYMBOLS_MAC_H_ // These are CoreGraphics SPI, verified to exist in both 10.5 and 10.6. @@ -24,4 +24,4 @@ int _CGSDefaultConnection(void); } // extern "C" #endif -#endif // WEBKIT_GLUE_PLUGINS_COREGRAPHICS_PRIVATE_SYMBOLS_MAC_H_ +#endif // WEBKIT_PLUGINS_NPAPI_COREGRAPHICS_PRIVATE_SYMBOLS_MAC_H_ diff --git a/webkit/glue/plugins/default_plugin_shared.h b/webkit/plugins/npapi/default_plugin_shared.h index 79d06b3..e1ab659 100644 --- a/webkit/glue/plugins/default_plugin_shared.h +++ b/webkit/plugins/npapi/default_plugin_shared.h @@ -5,8 +5,11 @@ // Thes file contains stuff that should be shared among projects that do some // special handling with default plugin -#ifndef WEBKIT_GLUE_PLUGINS_DEFAULT_PLUGIN_SHARED_H -#define WEBKIT_GLUE_PLUGINS_DEFAULT_PLUGIN_SHARED_H +#ifndef WEBKIT_PLUGINS_NPAPI_DEFAULT_PLUGIN_SHARED_H +#define WEBKIT_PLUGINS_NPAPI_DEFAULT_PLUGIN_SHARED_H + +namespace webkit { +namespace npapi { namespace default_plugin { @@ -28,4 +31,7 @@ const int kInstallMissingPluginMessage = WM_APP + 117; } // namespace default_plugin -#endif // WEBKIT_GLUE_PLUGINS_DEFAULT_PLUGIN_SHARED_H +} // namespace npapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_NPAPI_DEFAULT_PLUGIN_SHARED_H diff --git a/webkit/glue/plugins/gtk_plugin_container.cc b/webkit/plugins/npapi/gtk_plugin_container.cc index c80bbf1..056d31e 100644 --- a/webkit/glue/plugins/gtk_plugin_container.cc +++ b/webkit/plugins/npapi/gtk_plugin_container.cc @@ -2,12 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/gtk_plugin_container.h" +#include "webkit/plugins/npapi/gtk_plugin_container.h" #include <gtk/gtk.h> #include "base/basictypes.h" +namespace webkit { +namespace npapi { + namespace { // NOTE: This class doesn't have constructors/destructors, it is created @@ -71,7 +74,7 @@ class GtkPluginContainer : public GtkSocket { DISALLOW_IMPLICIT_CONSTRUCTORS(GtkPluginContainer); }; -} // anonymous namespace +} // namespace // Create a new instance of our GTK widget object. GtkWidget* gtk_plugin_container_new() { @@ -83,3 +86,6 @@ void gtk_plugin_container_set_size(GtkWidget *widget, int width, int height) { // Signal the parent that the size request has changed. gtk_widget_queue_resize_no_redraw(widget); } + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/gtk_plugin_container.h b/webkit/plugins/npapi/gtk_plugin_container.h index eed6b94..aee11c2 100644 --- a/webkit/glue/plugins/gtk_plugin_container.h +++ b/webkit/plugins/npapi/gtk_plugin_container.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_GTK_PLUGIN_CONTAINER_H_ -#define WEBKIT_GLUE_PLUGINS_GTK_PLUGIN_CONTAINER_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_GTK_PLUGIN_CONTAINER_H_ +#define WEBKIT_PLUGINS_NPAPI_GTK_PLUGIN_CONTAINER_H_ // Windowed plugins are embedded via XEmbed, which is implemented by // GtkPlug/GtkSocket. But we want to control sizing and positioning @@ -15,6 +15,9 @@ typedef struct _GtkWidget GtkWidget; +namespace webkit { +namespace npapi { + // Return a new GtkPluginContainer. // Intentionally GTK-style here since we're creating a custom GTK widget. // This is a GtkSocket subclass; see its documentation for available methods. @@ -23,4 +26,7 @@ GtkWidget* gtk_plugin_container_new(); // Sets the size of the GtkPluginContainer. void gtk_plugin_container_set_size(GtkWidget *widget, int width, int height); -#endif // WEBKIT_GLUE_PLUGINS_GTK_PLUGIN_CONTAINER_H_ +} // namespace npapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_NPAPI_GTK_PLUGIN_CONTAINER_H_ diff --git a/webkit/glue/plugins/gtk_plugin_container_manager.cc b/webkit/plugins/npapi/gtk_plugin_container_manager.cc index 2f82b24..5b9876a 100644 --- a/webkit/glue/plugins/gtk_plugin_container_manager.cc +++ b/webkit/plugins/npapi/gtk_plugin_container_manager.cc @@ -2,14 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/gtk_plugin_container_manager.h" +#include "webkit/plugins/npapi/gtk_plugin_container_manager.h" #include <gtk/gtk.h> #include "base/logging.h" #include "gfx/gtk_util.h" -#include "webkit/glue/plugins/gtk_plugin_container.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/gtk_plugin_container.h" +#include "webkit/plugins/npapi/webplugin.h" + +namespace webkit { +namespace npapi { GtkPluginContainerManager::GtkPluginContainerManager() : host_widget_(NULL) {} @@ -56,7 +59,7 @@ void GtkPluginContainerManager::DestroyPluginContainer( } void GtkPluginContainerManager::MovePluginContainer( - const webkit_glue::WebPluginGeometry& move) { + const WebPluginGeometry& move) { DCHECK(host_widget_); GtkWidget *widget = MapIDToWidget(move.window); if (!widget) @@ -153,3 +156,6 @@ void GtkPluginContainerManager::RealizeCallback(GtkWidget* widget, if (id) gtk_socket_add_id(GTK_SOCKET(widget), id); } + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/gtk_plugin_container_manager.h b/webkit/plugins/npapi/gtk_plugin_container_manager.h index 7f7db8d..c95d2c3 100644 --- a/webkit/glue/plugins/gtk_plugin_container_manager.h +++ b/webkit/plugins/npapi/gtk_plugin_container_manager.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_GTK_PLUGIN_CONTAINER_MANAGER_H_ -#define WEBKIT_GLUE_PLUGINS_GTK_PLUGIN_CONTAINER_MANAGER_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_GTK_PLUGIN_CONTAINER_MANAGER_H_ +#define WEBKIT_PLUGINS_NPAPI_GTK_PLUGIN_CONTAINER_MANAGER_H_ #include <gtk/gtk.h> #include <map> @@ -12,9 +12,10 @@ typedef struct _GtkWidget GtkWidget; -namespace webkit_glue { +namespace webkit { +namespace npapi { + struct WebPluginGeometry; -} // Helper class that creates and manages plugin containers (GtkSocket). class GtkPluginContainerManager { @@ -33,7 +34,7 @@ class GtkPluginContainerManager { // Takes an update from WebKit about a plugin's position and side and moves // the plugin accordingly. - void MovePluginContainer(const webkit_glue::WebPluginGeometry& move); + void MovePluginContainer(const WebPluginGeometry& move); private: // Maps a plugin XID to the corresponding container widget. @@ -54,4 +55,7 @@ class GtkPluginContainerManager { PluginWindowToWidgetMap plugin_window_to_widget_map_; }; -#endif // WEBKIT_GLUE_PLUGINS_GTK_PLUGIN_CONTAINER_MANAGER_H_ +} // namespace npapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_NPAPI_GTK_PLUGIN_CONTAINER_MANAGER_H_ diff --git a/webkit/glue/plugins/npapi_extension_thunk.cc b/webkit/plugins/npapi/npapi_extension_thunk.cc index 05a9c5d..ff3e59a 100644 --- a/webkit/glue/plugins/npapi_extension_thunk.cc +++ b/webkit/plugins/npapi/npapi_extension_thunk.cc @@ -2,33 +2,36 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/npapi_extension_thunk.h" +#include "webkit/plugins/npapi/npapi_extension_thunk.h" #include "base/logging.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "third_party/npapi/bindings/npapi_extensions.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/webplugin.h" -#include "webkit/glue/plugins/webplugin_delegate.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/webplugin.h" +#include "webkit/plugins/npapi/webplugin_delegate.h" #include "webkit/glue/webkit_glue.h" +namespace webkit { +namespace npapi { + // FindInstance() // Finds a PluginInstance from an NPP. // The caller must take a reference if needed. -static NPAPI::PluginInstance* FindInstance(NPP id) { +static PluginInstance* FindInstance(NPP id) { if (id == NULL) { NOTREACHED(); return NULL; } - return static_cast<NPAPI::PluginInstance*>(id->ndata); + return static_cast<PluginInstance*>(id->ndata); } // 2D device API --------------------------------------------------------------- static NPError Device2DQueryCapability(NPP id, int32_t capability, int32_t* value) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { plugin->webplugin()->delegate()->Device2DQueryCapability(capability, value); return NPERR_NO_ERROR; @@ -40,7 +43,7 @@ static NPError Device2DQueryCapability(NPP id, int32_t capability, static NPError Device2DQueryConfig(NPP id, const NPDeviceConfig* request, NPDeviceConfig* obtain) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device2DQueryConfig( static_cast<const NPDeviceContext2DConfig*>(request), @@ -52,7 +55,7 @@ static NPError Device2DQueryConfig(NPP id, static NPError Device2DInitializeContext(NPP id, const NPDeviceConfig* config, NPDeviceContext* context) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device2DInitializeContext( static_cast<const NPDeviceContext2DConfig*>(config), @@ -65,7 +68,7 @@ static NPError Device2DSetStateContext(NPP id, NPDeviceContext* context, int32_t state, intptr_t value) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device2DSetStateContext( static_cast<NPDeviceContext2D*>(context), state, value); @@ -77,7 +80,7 @@ static NPError Device2DGetStateContext(NPP id, NPDeviceContext* context, int32_t state, intptr_t* value) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device2DGetStateContext( static_cast<NPDeviceContext2D*>(context), state, value); @@ -89,7 +92,7 @@ static NPError Device2DFlushContext(NPP id, NPDeviceContext* context, NPDeviceFlushContextCallbackPtr callback, void* user_data) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { NPError err = plugin->webplugin()->delegate()->Device2DFlushContext( id, static_cast<NPDeviceContext2D*>(context), callback, user_data); @@ -109,7 +112,7 @@ static NPError Device2DFlushContext(NPP id, static NPError Device2DDestroyContext(NPP id, NPDeviceContext* context) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device2DDestroyContext( static_cast<NPDeviceContext2D*>(context)); @@ -141,7 +144,7 @@ static NPError Device2DMapBuffer(NPP id, static NPError Device3DQueryCapability(NPP id, int32_t capability, int32_t* value) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { plugin->webplugin()->delegate()->Device3DQueryCapability(capability, value); return NPERR_NO_ERROR; @@ -153,7 +156,7 @@ static NPError Device3DQueryCapability(NPP id, int32_t capability, static NPError Device3DQueryConfig(NPP id, const NPDeviceConfig* request, NPDeviceConfig* obtain) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DQueryConfig( static_cast<const NPDeviceContext3DConfig*>(request), @@ -165,7 +168,7 @@ static NPError Device3DQueryConfig(NPP id, static NPError Device3DInitializeContext(NPP id, const NPDeviceConfig* config, NPDeviceContext* context) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DInitializeContext( static_cast<const NPDeviceContext3DConfig*>(config), @@ -178,7 +181,7 @@ static NPError Device3DSetStateContext(NPP id, NPDeviceContext* context, int32_t state, intptr_t value) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DSetStateContext( static_cast<NPDeviceContext3D*>(context), state, value); @@ -190,7 +193,7 @@ static NPError Device3DGetStateContext(NPP id, NPDeviceContext* context, int32_t state, intptr_t* value) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DGetStateContext( static_cast<NPDeviceContext3D*>(context), state, value); @@ -202,7 +205,7 @@ static NPError Device3DFlushContext(NPP id, NPDeviceContext* context, NPDeviceFlushContextCallbackPtr callback, void* user_data) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DFlushContext( id, static_cast<NPDeviceContext3D*>(context), callback, user_data); @@ -212,7 +215,7 @@ static NPError Device3DFlushContext(NPP id, static NPError Device3DDestroyContext(NPP id, NPDeviceContext* context) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DDestroyContext( static_cast<NPDeviceContext3D*>(context)); @@ -224,7 +227,7 @@ static NPError Device3DCreateBuffer(NPP id, NPDeviceContext* context, size_t size, int32_t* buffer_id) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DCreateBuffer( static_cast<NPDeviceContext3D*>(context), size, buffer_id); @@ -235,7 +238,7 @@ static NPError Device3DCreateBuffer(NPP id, static NPError Device3DDestroyBuffer(NPP id, NPDeviceContext* context, int32_t buffer_id) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DDestroyBuffer( static_cast<NPDeviceContext3D*>(context), buffer_id); @@ -247,7 +250,7 @@ static NPError Device3DMapBuffer(NPP id, NPDeviceContext* context, int32_t buffer_id, NPDeviceBuffer* buffer) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DMapBuffer( static_cast<NPDeviceContext3D*>(context), buffer_id, buffer); @@ -258,7 +261,7 @@ static NPError Device3DMapBuffer(NPP id, // Experimental 3D device API -------------------------------------------------- static NPError Device3DGetNumConfigs(NPP id, int32_t* num_configs) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DGetNumConfigs(num_configs); } @@ -268,7 +271,7 @@ static NPError Device3DGetNumConfigs(NPP id, int32_t* num_configs) { static NPError Device3DGetConfigAttribs(NPP id, int32_t config, int32_t* attrib_list) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DGetConfigAttribs( config, @@ -281,7 +284,7 @@ static NPError Device3DCreateContext(NPP id, int32_t config, const int32_t* attrib_list, NPDeviceContext** context) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DCreateContext( config, @@ -299,7 +302,7 @@ static NPError Device3DSynchronizeContext( int32_t* output_attrib_list, NPDeviceSynchronizeContextCallbackPtr callback, void* callback_data) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DSynchronizeContext( id, @@ -319,7 +322,7 @@ static NPError Device3DRegisterCallback( int32_t callback_type, NPDeviceGenericCallbackPtr callback, void* callback_data) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->Device3DRegisterCallback( id, @@ -335,7 +338,7 @@ static NPError Device3DRegisterCallback( static NPError DeviceAudioQueryCapability(NPP id, int32_t capability, int32_t* value) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { plugin->webplugin()->delegate()->DeviceAudioQueryCapability(capability, value); @@ -348,7 +351,7 @@ static NPError DeviceAudioQueryCapability(NPP id, int32_t capability, static NPError DeviceAudioQueryConfig(NPP id, const NPDeviceConfig* request, NPDeviceConfig* obtain) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->DeviceAudioQueryConfig( static_cast<const NPDeviceContextAudioConfig*>(request), @@ -360,7 +363,7 @@ static NPError DeviceAudioQueryConfig(NPP id, static NPError DeviceAudioInitializeContext(NPP id, const NPDeviceConfig* config, NPDeviceContext* context) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->DeviceAudioInitializeContext( static_cast<const NPDeviceContextAudioConfig*>(config), @@ -373,7 +376,7 @@ static NPError DeviceAudioSetStateContext(NPP id, NPDeviceContext* context, int32_t state, intptr_t value) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { return plugin->webplugin()->delegate()->DeviceAudioSetStateContext( static_cast<NPDeviceContextAudio*>(context), state, value); @@ -385,7 +388,7 @@ static NPError DeviceAudioGetStateContext(NPP id, NPDeviceContext* context, int32_t state, intptr_t* value) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); return plugin->webplugin()->delegate()->DeviceAudioGetStateContext( static_cast<NPDeviceContextAudio*>(context), state, value); } @@ -394,14 +397,14 @@ static NPError DeviceAudioFlushContext(NPP id, NPDeviceContext* context, NPDeviceFlushContextCallbackPtr callback, void* user_data) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); return plugin->webplugin()->delegate()->DeviceAudioFlushContext( id, static_cast<NPDeviceContextAudio*>(context), callback, user_data); } static NPError DeviceAudioDestroyContext(NPP id, NPDeviceContext* context) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); return plugin->webplugin()->delegate()->DeviceAudioDestroyContext( static_cast<NPDeviceContextAudio*>(context)); } @@ -477,7 +480,7 @@ static NPError ChooseFile(NPP id, NPChooseFileMode mode, NPChooseFileCallback callback, void* user_data) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (!plugin) return NPERR_GENERIC_ERROR; @@ -490,7 +493,7 @@ static NPError ChooseFile(NPP id, } static void NumberOfFindResultsChanged(NPP id, int total, bool final_result) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) { plugin->webplugin()->delegate()->NumberOfFindResultsChanged( total, final_result); @@ -498,13 +501,13 @@ static void NumberOfFindResultsChanged(NPP id, int total, bool final_result) { } static void SelectedFindResultChanged(NPP id, int index) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) plugin->webplugin()->delegate()->SelectedFindResultChanged(index); } static NPWidgetExtensions* GetWidgetExtensions(NPP id) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (!plugin) return NULL; @@ -512,7 +515,7 @@ static NPWidgetExtensions* GetWidgetExtensions(NPP id) { } static NPError NPSetCursor(NPP id, NPCursorType type) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (!plugin) return NPERR_GENERIC_ERROR; @@ -521,15 +524,13 @@ static NPError NPSetCursor(NPP id, NPCursorType type) { } static NPFontExtensions* GetFontExtensions(NPP id) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (!plugin) return NULL; return plugin->webplugin()->delegate()->GetFontExtensions(); } -namespace NPAPI { - NPError GetPepperExtensionsFunctions(void* value) { static const NPNExtensions kExtensions = { &AcquireDevice, @@ -548,4 +549,5 @@ NPError GetPepperExtensionsFunctions(void* value) { return NPERR_NO_ERROR; } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/npapi_extension_thunk.h b/webkit/plugins/npapi/npapi_extension_thunk.h index fada6bc..683e07e 100644 --- a/webkit/glue/plugins/npapi_extension_thunk.h +++ b/webkit/plugins/npapi/npapi_extension_thunk.h @@ -2,22 +2,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_NPAPI_EXTENSION_THUNK_H_ -#define WEBKIT_GLUE_PLUGINS_NPAPI_EXTENSION_THUNK_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_NPAPI_EXTENSION_THUNK_H_ +#define WEBKIT_PLUGINS_NPAPI_NPAPI_EXTENSION_THUNK_H_ #include "third_party/npapi/bindings/npapi_extensions.h" // This file implements forwarding for the NPAPI "Pepper" extensions through to // the WebPluginDelegate associated with the plugin. -namespace NPAPI { +namespace webkit { +namespace npapi { // Implements NPN_GetValue for the case of NPNVPepperExtensions. The function // pointers in the returned structure implement all the extensions. NPError GetPepperExtensionsFunctions(void* value); -} // namespace NPAPI +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_PLUGINS_NPAPI_EXTENSION_THUNK_H_ +#endif // WEBKIT_PLUGINS_NPAPI_NPAPI_EXTENSION_THUNK_H_ diff --git a/webkit/plugins/npapi/plugin_constants_win.cc b/webkit/plugins/npapi/plugin_constants_win.cc new file mode 100644 index 0000000..5a6045c --- /dev/null +++ b/webkit/plugins/npapi/plugin_constants_win.cc @@ -0,0 +1,28 @@ +// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "webkit/plugins/npapi/plugin_constants_win.h" + +namespace webkit { +namespace npapi { + +const char16 kNativeWindowClassName[] = L"NativeWindowClass"; +const char16 kWrapperNativeWindowClassName[] = L"WrapperNativeWindowClass"; +const char16 kPaintMessageName[] = L"Chrome_CustomPaintil"; +const char16 kRegistryMozillaPlugins[] = L"SOFTWARE\\MozillaPlugins"; +const char16 kMozillaActiveXPlugin[] = L"npmozax.dll"; +const char16 kNewWMPPlugin[] = L"np-mswmp.dll"; +const char16 kOldWMPPlugin[] = L"npdsplay.dll"; +const char16 kYahooApplicationStatePlugin[] = L"npystate.dll"; +const char16 kWanWangProtocolHandlerPlugin[] = L"npww.dll"; +const char16 kFlashPlugin[] = L"npswf32.dll"; +const char16 kAcrobatReaderPlugin[] = L"nppdf32.dll"; +const char16 kRealPlayerPlugin[] = L"nppl3260.dll"; +const char16 kSilverlightPlugin[] = L"npctrl.dll"; +const char16 kJavaPlugin1[] = L"npjp2.dll"; +const char16 kJavaPlugin2[] = L"npdeploytk.dll"; +const char kGPUPluginMimeType[] = "application/vnd.google.chrome.gpu-plugin"; + +} // namespace npapi +} // namespace webkit diff --git a/webkit/plugins/npapi/plugin_constants_win.h b/webkit/plugins/npapi/plugin_constants_win.h new file mode 100644 index 0000000..6c39e03 --- /dev/null +++ b/webkit/plugins/npapi/plugin_constants_win.h @@ -0,0 +1,45 @@ +// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_CONSTANTS_WIN_H_ +#define WEBKIT_PLUGINS_NPAPI_PLUGIN_CONSTANTS_WIN_H_ + +#include "base/string16.h" + +namespace webkit { +namespace npapi { + +// The window class name for a plugin window. +extern const char16 kNativeWindowClassName[]; + +// The name of the window class name for the wrapper HWND around the actual +// plugin window that's used when running in multi-process mode. This window +// is created on the browser UI thread. +extern const char16 kWrapperNativeWindowClassName[]; + +// The name of the custom window message that the browser uses to tell the +// plugin process to paint a window. +extern const char16 kPaintMessageName[]; + +// The name of the registry key which NPAPI plugins update on installation. +extern const char16 kRegistryMozillaPlugins[]; + +extern const char16 kMozillaActiveXPlugin[]; +extern const char16 kNewWMPPlugin[]; +extern const char16 kOldWMPPlugin[]; +extern const char16 kYahooApplicationStatePlugin[]; +extern const char16 kWanWangProtocolHandlerPlugin[]; +extern const char16 kFlashPlugin[]; +extern const char16 kAcrobatReaderPlugin[]; +extern const char16 kRealPlayerPlugin[]; +extern const char16 kSilverlightPlugin[]; +extern const char16 kJavaPlugin1[]; +extern const char16 kJavaPlugin2[]; + +extern const char kGPUPluginMimeType[]; + +} // namespace npapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_PLUGIN_LIST_H_ diff --git a/webkit/glue/plugins/plugin_group.cc b/webkit/plugins/npapi/plugin_group.cc index 548e624..ec1b537 100644 --- a/webkit/glue/plugins/plugin_group.cc +++ b/webkit/plugins/npapi/plugin_group.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/glue/plugins/plugin_group.h" +#include "webkit/plugins/npapi/plugin_group.h" #include "base/linked_ptr.h" #include "base/string_util.h" @@ -10,8 +10,11 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "base/version.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugininfo.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugininfo.h" + +namespace webkit { +namespace npapi { const char* PluginGroup::kAdobeReaderGroupName = "Adobe Reader"; @@ -46,7 +49,7 @@ bool PluginGroup::IsPluginNameDisabledByPolicy(const string16& plugin_name) { /*static*/ bool PluginGroup::IsPluginPathDisabledByPolicy(const FilePath& plugin_path) { std::vector<WebPluginInfo> plugins; - NPAPI::PluginList::Singleton()->GetPlugins(false, &plugins); + PluginList::Singleton()->GetPlugins(false, &plugins); for (std::vector<WebPluginInfo>::const_iterator it = plugins.begin(); it != plugins.end(); ++it) { @@ -381,7 +384,7 @@ void PluginGroup::DisableOutdatedPlugins() { for (size_t i = 0; i < version_ranges_.size(); ++i) { if (IsPluginOutdated(*version, version_ranges_[i])) { it->enabled = false; - NPAPI::PluginList::Singleton()->DisablePlugin(it->path); + PluginList::Singleton()->DisablePlugin(it->path); } } } @@ -395,13 +398,16 @@ void PluginGroup::Enable(bool enable) { web_plugin_infos_.begin(); it != web_plugin_infos_.end(); ++it) { if (enable && !IsPluginNameDisabledByPolicy(it->name)) { - NPAPI::PluginList::Singleton()->EnablePlugin(it->path); + PluginList::Singleton()->EnablePlugin(it->path); it->enabled = true; enabled_plugin_exists = true; } else { it->enabled = false; - NPAPI::PluginList::Singleton()->DisablePlugin(it->path); + PluginList::Singleton()->DisablePlugin(it->path); } } enabled_ = enabled_plugin_exists; } + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_group.h b/webkit/plugins/npapi/plugin_group.h index 5098787..ae093ab 100644 --- a/webkit/glue/plugins/plugin_group.h +++ b/webkit/plugins/npapi/plugin_group.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ -#define WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ +#define WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ #pragma once #include <map> @@ -17,12 +17,15 @@ class DictionaryValue; class FilePath; +class TableModelArrayControllerTest; +class PluginExceptionsTableModelTest; class Version; -struct WebPluginInfo; -namespace NPAPI { +namespace webkit { +namespace npapi { + class PluginList; -}; +struct WebPluginInfo; // Hard-coded version ranges for plugin groups. struct VersionRangeDefinition { @@ -143,10 +146,10 @@ class PluginGroup { private: typedef std::map<std::string, PluginGroup*> PluginMap; - friend class NPAPI::PluginList; + friend class PluginList; friend class PluginGroupTest; - friend class TableModelArrayControllerTest; - friend class PluginExceptionsTableModelTest; + friend class ::TableModelArrayControllerTest; + friend class ::PluginExceptionsTableModelTest; // Generates the (short) identifier string for the given plugin. static std::string GetIdentifier(const WebPluginInfo& wpi); @@ -202,4 +205,7 @@ class PluginGroup { std::vector<int> web_plugin_positions_; }; -#endif // WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ +} // namespace npapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ diff --git a/webkit/glue/plugins/plugin_group_unittest.cc b/webkit/plugins/npapi/plugin_group_unittest.cc index 31dee1e..e82dc5a 100644 --- a/webkit/glue/plugins/plugin_group_unittest.cc +++ b/webkit/plugins/npapi/plugin_group_unittest.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/glue/plugins/plugin_group.h" +#include "webkit/plugins/npapi/plugin_group.h" #include <string> #include <vector> @@ -13,8 +13,11 @@ #include "base/values.h" #include "base/version.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/glue/plugins/webplugininfo.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/webplugininfo.h" +#include "webkit/plugins/npapi/plugin_list.h" + +namespace webkit { +namespace npapi { static const VersionRangeDefinition kPluginVersionRange[] = { { "", "", "3.0.44" } @@ -159,10 +162,8 @@ TEST(PluginGroupTest, PluginGroupDescription) { TEST(PluginGroupTest, PluginGroupDefinition) { const PluginGroupDefinition* definitions = - NPAPI::PluginList::GetPluginGroupDefinitions(); - for (size_t i = 0; - i < NPAPI::PluginList::GetPluginGroupDefinitionsSize(); - ++i) { + PluginList::GetPluginGroupDefinitions(); + for (size_t i = 0; i < PluginList::GetPluginGroupDefinitionsSize(); ++i) { scoped_ptr<PluginGroup> def_group( PluginGroupTest::CreatePluginGroup(definitions[i])); ASSERT_TRUE(def_group.get() != NULL); @@ -222,3 +223,6 @@ TEST(PluginGroupTest, DisabledByPolicy) { EXPECT_TRUE(PluginGroup::IsPluginNameDisabledByPolicy( ASCIIToUTF16("Google Earth"))); } + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_host.cc b/webkit/plugins/npapi/plugin_host.cc index 28aba02..1fd542f 100644 --- a/webkit/glue/plugins/plugin_host.cc +++ b/webkit/plugins/npapi/plugin_host.cc @@ -2,42 +2,47 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/plugin_host.h" +#include "webkit/plugins/npapi/plugin_host.h" #include "base/file_util.h" #include "base/logging.h" #include "base/scoped_ptr.h" #include "base/string_piece.h" #include "base/string_util.h" -#if defined(OS_MACOSX) -#include "base/sys_info.h" -#endif #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" +#include "build/build_config.h" #include "net/base/net_util.h" #include "third_party/npapi/bindings/npapi_extensions.h" #include "third_party/npapi/bindings/npruntime.h" #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/plugins/default_plugin_shared.h" -#include "webkit/glue/plugins/npapi_extension_thunk.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_delegate.h" -#include "webkit/glue/plugins/webplugininfo.h" +#include "webkit/plugins/npapi/default_plugin_shared.h" +#include "webkit/plugins/npapi/npapi_extension_thunk.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_delegate.h" +#include "webkit/plugins/npapi/webplugininfo.h" + +#if defined(OS_MACOSX) +#include "base/sys_info.h" +#endif using WebKit::WebBindings; +namespace webkit { +namespace npapi { + // Finds a PluginInstance from an NPP. // The caller must take a reference if needed. -static NPAPI::PluginInstance* FindInstance(NPP id) { +static PluginInstance* FindInstance(NPP id) { if (id == NULL) { return NULL; } - return reinterpret_cast<NPAPI::PluginInstance*>(id->ndata); + return reinterpret_cast<PluginInstance*>(id->ndata); } #if defined(OS_MACOSX) @@ -50,8 +55,6 @@ static bool SupportsSharingAcceleratedSurfaces() { } #endif -namespace NPAPI { - scoped_refptr<PluginHost> PluginHost::singleton_; PluginHost::PluginHost() { @@ -277,13 +280,19 @@ bool PluginHost::SetPostData(const char* buf, return !err; } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit extern "C" { +using webkit::npapi::FindInstance; +using webkit::npapi::PluginHost; +using webkit::npapi::PluginInstance; +using webkit::npapi::WebPlugin; + // Allocates memory from the host's memory space. void* NPN_MemAlloc(uint32_t size) { - scoped_refptr<NPAPI::PluginHost> host(NPAPI::PluginHost::Singleton()); + scoped_refptr<PluginHost> host(PluginHost::Singleton()); if (host != NULL) { // Note: We must use the same allocator/deallocator // that is used by the javascript library, as some of the @@ -296,7 +305,7 @@ void* NPN_MemAlloc(uint32_t size) { // Deallocates memory from the host's memory space void NPN_MemFree(void* ptr) { - scoped_refptr<NPAPI::PluginHost> host(NPAPI::PluginHost::Singleton()); + scoped_refptr<PluginHost> host(PluginHost::Singleton()); if (host != NULL) { if (ptr != NULL && ptr != reinterpret_cast<void*>(-1)) free(ptr); @@ -320,8 +329,8 @@ NPError NPN_RequestRead(NPStream* stream, NPByteRange* range_list) { if (!stream || !range_list) return NPERR_GENERIC_ERROR; - scoped_refptr<NPAPI::PluginInstance> plugin( - reinterpret_cast<NPAPI::PluginInstance*>(stream->ndata)); + scoped_refptr<PluginInstance> plugin( + reinterpret_cast<PluginInstance*>(stream->ndata)); if (!plugin.get()) return NPERR_GENERIC_ERROR; @@ -338,7 +347,7 @@ static NPError GetURLNotify(NPP id, if (!url) return NPERR_INVALID_URL; - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (!plugin.get()) { return NPERR_GENERIC_ERROR; } @@ -402,7 +411,7 @@ static NPError PostURLNotify(NPP id, if (!url) return NPERR_INVALID_URL; - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (!plugin.get()) { NOTREACHED(); return NPERR_GENERIC_ERROR; @@ -549,7 +558,7 @@ NPError NPN_DestroyStream(NPP id, NPStream* stream, NPReason reason) { // // - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin.get() == NULL) { NOTREACHED(); return NPERR_GENERIC_ERROR; @@ -565,7 +574,7 @@ const char* NPN_UserAgent(NPP id) { // else Flash won't request windowless mode. bool use_mozilla_user_agent = true; if (id) { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<PluginInstance> plugin = FindInstance(id); if (plugin.get() && !plugin->use_mozilla_user_agent()) use_mozilla_user_agent = false; } @@ -575,11 +584,12 @@ const char* NPN_UserAgent(NPP id) { "Gecko/20061103 Firefox/2.0a1"; #elif defined(OS_MACOSX) // Silverlight 4 doesn't handle events correctly unless we claim to be Safari. - scoped_refptr<NPAPI::PluginInstance> plugin; + scoped_refptr<PluginInstance> plugin; if (id) plugin = FindInstance(id); if (plugin.get()) { - WebPluginInfo plugin_info = plugin->plugin_lib()->plugin_info(); + webkit::npapi::WebPluginInfo plugin_info = + plugin->plugin_lib()->plugin_info(); if (plugin_info.name == ASCIIToUTF16("Silverlight Plug-In") && StartsWith(plugin_info.version, ASCIIToUTF16("4."), false)) { return "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-us) " @@ -611,7 +621,7 @@ void NPN_InvalidateRect(NPP id, NPRect *invalidRect) { // plug-ins at regularly timed intervals. To force a paint message, the // plug-in can call NPN_ForceRedraw after calling this method. - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin.get() && plugin->webplugin()) { if (invalidRect) { #if defined(OS_WIN) @@ -644,7 +654,7 @@ void NPN_InvalidateRegion(NPP id, NPRegion invalidRegion) { // TODO: this is overkill--add platform-specific region handling (at the // very least, fetch the region's bounding box and pass it to InvalidateRect). - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); DCHECK(plugin.get() != NULL); if (plugin.get() && plugin->webplugin()) plugin->webplugin()->Invalidate(); @@ -673,7 +683,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { switch (static_cast<int>(variable)) { case NPNVWindowNPObject: { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); NPObject *np_object = plugin->webplugin()->GetWindowScriptNPObject(); // Return value is expected to be retained, as // described here: @@ -689,7 +699,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { break; } case NPNVPluginElementNPObject: { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); NPObject *np_object = plugin->webplugin()->GetPluginElement(); // Return value is expected to be retained, as // described here: @@ -706,7 +716,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { } #if !defined(OS_MACOSX) // OS X doesn't have windowed plugins. case NPNVnetscapeWindow: { - scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + scoped_refptr<PluginInstance> plugin = FindInstance(id); if (!plugin.get()) { NOTREACHED(); return NPERR_GENERIC_ERROR; @@ -743,33 +753,33 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { } case NPNVprivateModeBool: { NPBool* private_mode = reinterpret_cast<NPBool*>(value); - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); *private_mode = plugin->webplugin()->IsOffTheRecord(); rv = NPERR_NO_ERROR; break; } - case default_plugin::kMissingPluginStatusStart + - default_plugin::MISSING_PLUGIN_AVAILABLE: + case webkit::npapi::default_plugin::kMissingPluginStatusStart + + webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE: // fall through - case default_plugin::kMissingPluginStatusStart + - default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD: { + case webkit::npapi::default_plugin::kMissingPluginStatusStart + + webkit::npapi::default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD: { // This is a hack for the default plugin to send notification to // renderer. Even though we check if the plugin is the default plugin, // we still need to worry about future standard change that may conflict // with the variable definition, in order to avoid duplicate case clauses // in this big switch statement. - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin->plugin_lib()->plugin_info().path.value() == - kDefaultPluginLibraryName) { - plugin->webplugin()->OnMissingPluginStatus( - variable - default_plugin::kMissingPluginStatusStart); + webkit::npapi::kDefaultPluginLibraryName) { + plugin->webplugin()->OnMissingPluginStatus(variable - + webkit::npapi::default_plugin::kMissingPluginStatusStart); } break; } #if defined(OS_MACOSX) case NPNVpluginDrawingModel: { // return the drawing model that was negotiated when we initialized. - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); *reinterpret_cast<int*>(value) = plugin->drawing_model(); rv = NPERR_NO_ERROR; break; @@ -802,7 +812,8 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { // TODO(stuartmorgan): Once existing CA plugins have implemented the // invalidating version, remove support for this one. NPBool* supports_model = reinterpret_cast<NPBool*>(value); - *supports_model = SupportsSharingAcceleratedSurfaces() ? true : false; + *supports_model = webkit::npapi::SupportsSharingAcceleratedSurfaces() ? + true : false; rv = NPERR_NO_ERROR; break; } @@ -826,7 +837,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { // If the plugin is not started in a Pepper implementation, it // will likely fail when it tries to use any of the functions // attached to the extension vector. - rv = NPAPI::GetPepperExtensionsFunctions(value); + rv = webkit::npapi::GetPepperExtensionsFunctions(value); break; default: DVLOG(1) << "NPN_GetValue(" << variable << ") is not implemented yet."; @@ -838,7 +849,7 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { NPError NPN_SetValue(NPP id, NPPVariable variable, void* value) { // Allows the plugin to set various modes - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); switch(variable) { case NPPVpluginWindowBool: { // Sets windowless mode for display of the plugin @@ -879,7 +890,7 @@ NPError NPN_SetValue(NPP id, NPPVariable variable, void* value) { if (model == NPDrawingModelCoreGraphics || model == NPDrawingModelInvalidatingCoreAnimation || (model == NPDrawingModelCoreAnimation && - SupportsSharingAcceleratedSurfaces())) { + webkit::npapi::SupportsSharingAcceleratedSurfaces())) { plugin->set_drawing_model(static_cast<NPDrawingModel>(model)); return NPERR_NO_ERROR; } @@ -923,13 +934,13 @@ void* NPN_GetJavaPeer(NPP) { } void NPN_PushPopupsEnabledState(NPP id, NPBool enabled) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) plugin->PushPopupsEnabledState(enabled ? true : false); } void NPN_PopPopupsEnabledState(NPP id) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) plugin->PopPopupsEnabledState(); } @@ -937,7 +948,7 @@ void NPN_PopPopupsEnabledState(NPP id) { void NPN_PluginThreadAsyncCall(NPP id, void (*func)(void*), void* user_data) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) plugin->PluginThreadAsyncCall(func, user_data); } @@ -965,11 +976,11 @@ NPError NPN_GetValueForURL(NPP id, break; } case NPNURLVCookie: { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (!plugin) return NPERR_GENERIC_ERROR; - webkit_glue::WebPlugin* webplugin = plugin->webplugin(); + WebPlugin* webplugin = plugin->webplugin(); if (!webplugin) return NPERR_GENERIC_ERROR; @@ -1005,11 +1016,11 @@ NPError NPN_SetValueForURL(NPP id, switch (variable) { case NPNURLVCookie: { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (!plugin) return NPERR_GENERIC_ERROR; - webkit_glue::WebPlugin* webplugin = plugin->webplugin(); + WebPlugin* webplugin = plugin->webplugin(); if (!webplugin) return NPERR_GENERIC_ERROR; @@ -1051,7 +1062,7 @@ uint32_t NPN_ScheduleTimer(NPP id, uint32_t interval, NPBool repeat, void (*func)(NPP id, uint32_t timer_id)) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (!plugin) return 0; @@ -1059,7 +1070,7 @@ uint32_t NPN_ScheduleTimer(NPP id, } void NPN_UnscheduleTimer(NPP id, uint32_t timer_id) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin) plugin->UnscheduleTimer(timer_id); } @@ -1068,7 +1079,7 @@ NPError NPN_PopUpContextMenu(NPP id, NPMenu* menu) { if (!menu) return NPERR_INVALID_PARAM; - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin.get()) { return plugin->PopUpContextMenu(menu); } @@ -1080,7 +1091,7 @@ NPBool NPN_ConvertPoint(NPP id, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(id)); + scoped_refptr<PluginInstance> plugin(FindInstance(id)); if (plugin.get()) { return plugin->ConvertPoint(sourceX, sourceY, sourceSpace, destX, destY, destSpace); @@ -1102,7 +1113,7 @@ NPBool NPN_UnfocusInstance(NPP id, NPFocusDirection direction) { } void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { - scoped_refptr<NPAPI::PluginInstance> plugin(FindInstance(instance)); + scoped_refptr<PluginInstance> plugin(FindInstance(instance)); if (plugin.get()) { plugin->URLRedirectResponse(!!allow, notify_data); } diff --git a/webkit/glue/plugins/plugin_host.h b/webkit/plugins/npapi/plugin_host.h index 4763df1..f6359c5 100644 --- a/webkit/glue/plugins/plugin_host.h +++ b/webkit/plugins/npapi/plugin_host.h @@ -4,8 +4,8 @@ // TODO: Need mechanism to cleanup the static instance -#ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_HOST_H__ -#define WEBKIT_GLUE_PLUGIN_PLUGIN_HOST_H__ +#ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_HOST_H_ +#define WEBKIT_PLUGINS_NPAPI_PLUGIN_HOST_H_ #include <string> #include <vector> @@ -14,8 +14,9 @@ #include "third_party/npapi/bindings/npapi.h" #include "third_party/npapi/bindings/nphostapi.h" -namespace NPAPI -{ +namespace webkit { +namespace npapi { + class PluginInstance; // The Plugin Host implements the NPN_xxx functions for NPAPI plugins. @@ -58,6 +59,7 @@ class PluginHost : public base::RefCounted<PluginHost> { DISALLOW_COPY_AND_ASSIGN(PluginHost); }; -} // namespace NPAPI +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_PLUGIN_PLUGIN_HOST_H__ +#endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_HOST_H_ diff --git a/webkit/glue/plugins/plugin_instance.cc b/webkit/plugins/npapi/plugin_instance.cc index 4ccbadf..6f65456 100644 --- a/webkit/glue/plugins/plugin_instance.cc +++ b/webkit/plugins/npapi/plugin_instance.cc @@ -2,28 +2,28 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "build/build_config.h" - -#include "webkit/glue/plugins/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "build/build_config.h" #include "base/file_util.h" #include "base/message_loop.h" #include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/plugins/plugin_host.h" -#include "webkit/glue/plugins/plugin_lib.h" -#include "webkit/glue/plugins/plugin_stream_url.h" -#include "webkit/glue/plugins/plugin_string_stream.h" -#include "webkit/glue/plugins/webplugin.h" -#include "webkit/glue/plugins/webplugin_delegate.h" +#include "webkit/plugins/npapi/plugin_host.h" +#include "webkit/plugins/npapi/plugin_lib.h" +#include "webkit/plugins/npapi/plugin_stream_url.h" +#include "webkit/plugins/npapi/plugin_string_stream.h" +#include "webkit/plugins/npapi/webplugin.h" +#include "webkit/plugins/npapi/webplugin_delegate.h" #include "net/base/escape.h" #if defined(OS_MACOSX) #include <ApplicationServices/ApplicationServices.h> #endif -namespace NPAPI { +namespace webkit { +namespace npapi { PluginInstance::PluginInstance(PluginLib *plugin, const std::string &mime_type) : plugin_(plugin), @@ -130,7 +130,7 @@ void PluginInstance::CloseStreams() { in_close_streams_ = false; } -webkit_glue::WebPluginResourceClient* PluginInstance::GetRangeRequest( +WebPluginResourceClient* PluginInstance::GetRangeRequest( int id) { PendingRangeRequestMap::iterator iter = pending_range_requests_.find(id); if (iter == pending_range_requests_.end()) { @@ -138,7 +138,7 @@ webkit_glue::WebPluginResourceClient* PluginInstance::GetRangeRequest( return NULL; } - webkit_glue::WebPluginResourceClient* rv = iter->second->AsResourceClient(); + WebPluginResourceClient* rv = iter->second->AsResourceClient(); pending_range_requests_.erase(iter); return rv; } @@ -665,7 +665,7 @@ void PluginInstance::URLRedirectResponse(bool allow, void* notify_data) { stream_index != open_streams_.end(); ++stream_index) { PluginStream* plugin_stream = *stream_index; if (plugin_stream->notify_data() == notify_data) { - webkit_glue::WebPluginResourceClient* resource_client = + WebPluginResourceClient* resource_client = plugin_stream->AsResourceClient(); webplugin_->URLRedirectResponse(allow, resource_client->ResourceId()); if (allow) { @@ -677,4 +677,5 @@ void PluginInstance::URLRedirectResponse(bool allow, void* notify_data) { } } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_instance.h b/webkit/plugins/npapi/plugin_instance.h index fa0320e..98a5838 100644 --- a/webkit/glue/plugins/plugin_instance.h +++ b/webkit/plugins/npapi/plugin_instance.h @@ -5,8 +5,8 @@ // TODO: Need to deal with NPAPI's NPSavedData. // I haven't seen plugins use it yet. -#ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ -#define WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ +#ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_INSTANCE_H_ +#define WEBKIT_PLUGINS_NPAPI_PLUGIN_INSTANCE_H_ #include <map> #include <stack> @@ -26,18 +26,17 @@ class MessageLoop; -namespace webkit_glue { -class WebPlugin; -class WebPluginResourceClient; -} +namespace webkit { +namespace npapi { -namespace NPAPI -{ class PluginLib; class PluginHost; class PluginStream; class PluginStreamUrl; class PluginDataStream; +class WebPlugin; +class WebPluginResourceClient; + #if defined(OS_MACOSX) class ScopedCurrentPluginEvent; #endif @@ -96,15 +95,15 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> { void set_transparent(bool value) { transparent_ = value; } // Get/Set the WebPlugin associated with this instance - webkit_glue::WebPlugin* webplugin() { return webplugin_; } - void set_web_plugin(webkit_glue::WebPlugin* webplugin) { + WebPlugin* webplugin() { return webplugin_; } + void set_web_plugin(WebPlugin* webplugin) { webplugin_ = webplugin; } // Get the mimeType for this plugin stream const std::string &mime_type() { return mime_type_; } - NPAPI::PluginLib* plugin_lib() { return plugin_; } + PluginLib* plugin_lib() { return plugin_; } #if defined(OS_MACOSX) // Get/Set the Mac NPAPI drawing and event models @@ -148,7 +147,7 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> { // Returns the WebPluginResourceClient object for a stream that has become // seekable. - webkit_glue::WebPluginResourceClient* GetRangeRequest(int id); + WebPluginResourceClient* GetRangeRequest(int id); // Have the plugin create it's script object. NPObject *GetPluginScriptableObject(); @@ -284,7 +283,7 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> { // the possiblity of conforming to it (http://b/issue?id=936667). We // could also log a bug with Real, which would save the effort. uint8 zero_padding_[96]; - scoped_refptr<NPAPI::PluginLib> plugin_; + scoped_refptr<PluginLib> plugin_; NPP npp_; scoped_refptr<PluginHost> host_; NPPluginFuncs* npp_functions_; @@ -292,7 +291,7 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> { gfx::PluginWindowHandle window_handle_; bool windowless_; bool transparent_; - webkit_glue::WebPlugin* webplugin_; + WebPlugin* webplugin_; std::string mime_type_; GURL get_url_; intptr_t get_notify_data_; @@ -370,6 +369,7 @@ class ScopedCurrentPluginEvent { }; #endif -} // namespace NPAPI +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ +#endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_INSTANCE_H_ diff --git a/webkit/glue/plugins/plugin_instance_mac.mm b/webkit/plugins/npapi/plugin_instance_mac.mm index 9800198..bbcef8a 100644 --- a/webkit/glue/plugins/plugin_instance_mac.mm +++ b/webkit/plugins/npapi/plugin_instance_mac.mm @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "build/build_config.h" - #import <AppKit/AppKit.h> #include "base/logging.h" -#include "webkit/glue/plugins/plugin_instance.h" +#include "build/build_config.h" +#include "webkit/plugins/npapi/plugin_instance.h" // When C++ exceptions are disabled, the C++ library defines |try| and // |catch| so as to allow exception-expecting C++ code to build properly when @@ -26,6 +25,9 @@ @end #endif +namespace webkit { +namespace npapi { + namespace { // Returns an autoreleased NSEvent constructed from the given np_event, @@ -76,8 +78,6 @@ NSEvent* NSEventForNPCocoaEvent(NPCocoaEvent* np_event, NSWindow* window) { } // namespace -namespace NPAPI { - NPError PluginInstance::PopUpContextMenu(NPMenu* menu) { if (!currently_handled_event_) return NPERR_GENERIC_ERROR; @@ -130,4 +130,5 @@ NPError PluginInstance::PopUpContextMenu(NPMenu* menu) { return return_val; } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_lib.cc b/webkit/plugins/npapi/plugin_lib.cc index 4ae4da4..d801ee0 100644 --- a/webkit/glue/plugins/plugin_lib.cc +++ b/webkit/plugins/npapi/plugin_lib.cc @@ -2,18 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/plugin_lib.h" +#include "webkit/plugins/npapi/plugin_lib.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/metrics/stats_counters.h" #include "base/string_util.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/plugin_host.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_host.h" +#include "webkit/plugins/npapi/plugin_list.h" -namespace NPAPI { +namespace webkit { +namespace npapi { const char kPluginLibrariesLoadedCounter[] = "PluginLibrariesLoaded"; const char kPluginInstancesActiveCounter[] = "PluginInstancesActive"; @@ -346,4 +347,5 @@ void PluginLib::Shutdown() { } } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_lib.h b/webkit/plugins/npapi/plugin_lib.h index ca46e41..081e593 100644 --- a/webkit/glue/plugins/plugin_lib.h +++ b/webkit/plugins/npapi/plugin_lib.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_PLUGIN_LIB_H_ -#define WEBKIT_GLUE_PLUGINS_PLUGIN_LIB_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_LIB_H_ +#define WEBKIT_PLUGINS_NPAPI_PLUGIN_LIB_H_ #include <string> #include <vector> @@ -12,13 +12,14 @@ #include "base/native_library.h" #include "base/ref_counted.h" #include "build/build_config.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugin.h" class FilePath; struct WebPluginInfo; -namespace NPAPI { +namespace webkit { +namespace npapi { class PluginInstance; @@ -115,6 +116,7 @@ class PluginLib : public base::RefCounted<PluginLib> { DISALLOW_COPY_AND_ASSIGN(PluginLib); }; -} // namespace NPAPI +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_PLUGINS_PLUGIN_LIB_H_ +#endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_LIB_H_ diff --git a/webkit/glue/plugins/plugin_lib_mac.mm b/webkit/plugins/npapi/plugin_lib_mac.mm index 89444c8..6e3a22a 100644 --- a/webkit/glue/plugins/plugin_lib_mac.mm +++ b/webkit/plugins/npapi/plugin_lib_mac.mm @@ -4,7 +4,7 @@ #import <Carbon/Carbon.h> -#include "webkit/glue/plugins/plugin_lib.h" +#include "webkit/plugins/npapi/plugin_lib.h" #include "base/mac/scoped_cftyperef.h" #include "base/native_library.h" @@ -13,18 +13,19 @@ #include "base/string_util.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" -#include "webkit/glue/plugins/plugin_list.h" - -static const short kSTRTypeDefinitionResourceID = 128; -static const short kSTRTypeDescriptionResourceID = 127; -static const short kSTRPluginDescriptionResourceID = 126; +#include "webkit/plugins/npapi/plugin_list.h" using base::mac::ScopedCFTypeRef; -namespace NPAPI { +namespace webkit { +namespace npapi { namespace { +const short kSTRTypeDefinitionResourceID = 128; +const short kSTRTypeDescriptionResourceID = 127; +const short kSTRPluginDescriptionResourceID = 126; + NSDictionary* GetMIMETypes(CFBundleRef bundle) { NSString* mime_filename = (NSString*)CFBundleGetValueForInfoDictionaryKey(bundle, @@ -345,4 +346,5 @@ bool PluginLib::ReadWebPluginInfo(const FilePath &filename, return false; } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_lib_posix.cc b/webkit/plugins/npapi/plugin_lib_posix.cc index ac937e1..19fa141 100644 --- a/webkit/glue/plugins/plugin_lib_posix.cc +++ b/webkit/plugins/npapi/plugin_lib_posix.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/glue/plugins/plugin_lib.h" +#include "webkit/plugins/npapi/plugin_lib.h" #include <dlfcn.h> #if defined(OS_OPENBSD) @@ -21,15 +21,16 @@ #include "base/string_util.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" // These headers must be included in this order to make the declaration gods // happy. #include "base/third_party/nspr/prcpucfg_linux.h" -namespace { +namespace webkit { +namespace npapi { -using NPAPI::PluginList; +namespace { // Copied from nsplugindefs.h instead of including the file since it has a bunch // of dependencies. @@ -134,9 +135,7 @@ void UnwrapNSPluginWrapper(void **dl, FilePath* unwrapped_path) { *unwrapped_path = path; } -} // anonymous namespace - -namespace NPAPI { +} // namespace bool PluginLib::ReadWebPluginInfo(const FilePath& filename, WebPluginInfo* info) { @@ -253,4 +252,6 @@ void PluginLib::ParseMIMEDescription( } } -} // namespace NPAPI + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_lib_unittest.cc b/webkit/plugins/npapi/plugin_lib_unittest.cc index 45c4bb6..1794da90 100644 --- a/webkit/glue/plugins/plugin_lib_unittest.cc +++ b/webkit/plugins/npapi/plugin_lib_unittest.cc @@ -2,21 +2,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/plugin_lib.h" +#include "webkit/plugins/npapi/plugin_lib.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" +namespace webkit { +namespace npapi { + // Test the unloading of plugin libs. Bug http://crbug.com/46526 showed that // if UnloadAllPlugins() simply iterates through the g_loaded_libs global // variable, we can get a crash if no plugin libs were marked as always loaded. -class PluginLibTest : public NPAPI::PluginLib { +class PluginLibTest : public PluginLib { public: - PluginLibTest() : NPAPI::PluginLib(WebPluginInfo(), NULL) { + PluginLibTest() : PluginLib(WebPluginInfo(), NULL) { } - using NPAPI::PluginLib::Unload; + using PluginLib::Unload; }; TEST(PluginLibLoading, UnloadAllPlugins) { @@ -26,7 +29,7 @@ TEST(PluginLibLoading, UnloadAllPlugins) { // Try with a single plugin lib. scoped_refptr<PluginLibTest> plugin_lib1(new PluginLibTest()); - NPAPI::PluginLib::UnloadAllPlugins(); + PluginLib::UnloadAllPlugins(); // Need to create it again, it should have been destroyed above. ASSERT_EQ(static_cast<PluginLibTest*>(NULL), @@ -35,7 +38,7 @@ TEST(PluginLibLoading, UnloadAllPlugins) { // Try with two plugin libs. plugin_lib1 = new PluginLibTest(); scoped_refptr<PluginLibTest> plugin_lib2(new PluginLibTest()); - NPAPI::PluginLib::UnloadAllPlugins(); + PluginLib::UnloadAllPlugins(); // Need to create it again, it should have been destroyed above. ASSERT_EQ(static_cast<PluginLibTest*>(NULL), @@ -45,7 +48,7 @@ TEST(PluginLibLoading, UnloadAllPlugins) { plugin_lib1 = new PluginLibTest(); plugin_lib2 = new PluginLibTest(); plugin_lib1->Unload(); - NPAPI::PluginLib::UnloadAllPlugins(); + PluginLib::UnloadAllPlugins(); // Need to create it again, it should have been destroyed above. ASSERT_EQ(static_cast<PluginLibTest*>(NULL), @@ -54,7 +57,7 @@ TEST(PluginLibLoading, UnloadAllPlugins) { // Now try to manually Unload the only one and then UnloadAll. plugin_lib1 = new PluginLibTest(); plugin_lib1->Unload(); - NPAPI::PluginLib::UnloadAllPlugins(); + PluginLib::UnloadAllPlugins(); } #if defined(OS_LINUX) @@ -62,7 +65,7 @@ TEST(PluginLibLoading, UnloadAllPlugins) { // Test parsing a simple description: Real Audio. TEST(MIMEDescriptionParse, Simple) { std::vector<WebPluginMimeType> types; - NPAPI::PluginLib::ParseMIMEDescription( + PluginLib::ParseMIMEDescription( "audio/x-pn-realaudio-plugin:rpm:RealAudio document;", &types); ASSERT_EQ(1U, types.size()); @@ -76,7 +79,7 @@ TEST(MIMEDescriptionParse, Simple) { // Test parsing a multi-entry description: QuickTime as provided by Totem. TEST(MIMEDescriptionParse, Multi) { std::vector<WebPluginMimeType> types; - NPAPI::PluginLib::ParseMIMEDescription( + PluginLib::ParseMIMEDescription( "video/quicktime:mov:QuickTime video;video/mp4:mp4:MPEG-4 " "video;image/x-macpaint:pntg:MacPaint Bitmap image;image/x" "-quicktime:pict, pict1, pict2:QuickTime image;video/x-m4v" @@ -98,7 +101,7 @@ TEST(MIMEDescriptionParse, Multi) { // This comes from loading Totem with LANG=ja_JP.UTF-8. TEST(MIMEDescriptionParse, JapaneseUTF8) { std::vector<WebPluginMimeType> types; - NPAPI::PluginLib::ParseMIMEDescription( + PluginLib::ParseMIMEDescription( "audio/x-ogg:ogg:Ogg \xe3\x82\xaa\xe3\x83\xbc\xe3\x83\x87" "\xe3\x82\xa3\xe3\x83\xaa", &types); @@ -111,11 +114,11 @@ TEST(MIMEDescriptionParse, JapaneseUTF8) { // Test that we handle corner cases gracefully. TEST(MIMEDescriptionParse, CornerCases) { std::vector<WebPluginMimeType> types; - NPAPI::PluginLib::ParseMIMEDescription("mime/type:", &types); + PluginLib::ParseMIMEDescription("mime/type:", &types); EXPECT_TRUE(types.empty()); types.clear(); - NPAPI::PluginLib::ParseMIMEDescription("mime/type:ext1:", &types); + PluginLib::ParseMIMEDescription("mime/type:ext1:", &types); ASSERT_EQ(1U, types.size()); EXPECT_EQ("mime/type", types[0].mime_type); EXPECT_EQ(1U, types[0].file_extensions.size()); @@ -126,7 +129,7 @@ TEST(MIMEDescriptionParse, CornerCases) { // This Java plugin has embedded semicolons in the mime type. TEST(MIMEDescriptionParse, ComplicatedJava) { std::vector<WebPluginMimeType> types; - NPAPI::PluginLib::ParseMIMEDescription( + PluginLib::ParseMIMEDescription( "application/x-java-vm:class,jar:IcedTea;application/x-java" "-applet:class,jar:IcedTea;application/x-java-applet;versio" "n=1.1:class,jar:IcedTea;application/x-java-applet;version=" @@ -150,3 +153,6 @@ TEST(MIMEDescriptionParse, ComplicatedJava) { } #endif // defined(OS_LINUX) + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_lib_win.cc b/webkit/plugins/npapi/plugin_lib_win.cc index 382c2c8..6132d45 100644 --- a/webkit/glue/plugins/plugin_lib_win.cc +++ b/webkit/plugins/npapi/plugin_lib_win.cc @@ -2,16 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/plugin_lib.h" +#include "webkit/plugins/npapi/plugin_lib.h" #include "base/file_version_info.h" #include "base/file_version_info_win.h" #include "base/logging.h" #include "base/path_service.h" -#include "webkit/glue/plugins/plugin_constants_win.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_constants_win.h" +#include "webkit/plugins/npapi/plugin_list.h" -namespace NPAPI { +namespace webkit { +namespace npapi { bool PluginLib::ReadWebPluginInfo(const FilePath &filename, WebPluginInfo* info) { @@ -43,4 +44,5 @@ bool PluginLib::ReadWebPluginInfo(const FilePath &filename, return PluginList::CreateWebPluginInfo(pvi, info); } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_list.cc b/webkit/plugins/npapi/plugin_list.cc index a2b4cf5..a92373e 100644 --- a/webkit/glue/plugins/plugin_list.cc +++ b/webkit/plugins/npapi/plugin_list.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/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" #include <algorithm> @@ -15,9 +15,9 @@ #include "base/utf_string_conversions.h" #include "googleurl/src/gurl.h" #include "net/base/mime_util.h" -#include "webkit/glue/plugins/plugin_constants_win.h" -#include "webkit/glue/plugins/plugin_lib.h" #include "webkit/glue/webkit_glue.h" +#include "webkit/plugins/npapi/plugin_constants_win.h" +#include "webkit/plugins/npapi/plugin_lib.h" #include "webkit/plugins/plugin_switches.h" #if defined(OS_POSIX) @@ -25,7 +25,11 @@ #include "base/third_party/valgrind/valgrind.h" #endif // defined(OS_POSIX) -namespace NPAPI { +namespace webkit { +namespace npapi { + +FilePath::CharType kDefaultPluginLibraryName[] = + FILE_PATH_LITERAL("default_plugin"); #if defined(OS_MACOSX) // Plugin Groups for Mac. @@ -74,7 +78,7 @@ static const PluginGroupDefinition kGroupDefinitions[] = { // TODO(panayiotis): We should group "RealJukebox NS Plugin" with the rest of // the RealPlayer files. static const VersionRangeDefinition kQuicktimeVersionRange[] = { - { "", "", "7.6.9" } + { "", "", "7.6.8" } }; static const VersionRangeDefinition kJavaVersionRange[] = { { "0", "7", "6.0.220" } // "220" is not a typo. @@ -97,9 +101,6 @@ static const VersionRangeDefinition kShockwaveVersionRange[] = { static const VersionRangeDefinition kDivXVersionRange[] = { { "", "", "1.4.3.4" } }; -static const VersionRangeDefinition kRealPlayerVersionRange[] = { - { "", "", "12.0.1.609" } -}; static const PluginGroupDefinition kGroupDefinitions[] = { { "apple-quicktime", "Quicktime", "QuickTime Plug-in", kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange), @@ -121,14 +122,16 @@ static const PluginGroupDefinition kGroupDefinitions[] = { arraysize(kDivXVersionRange), "http://download.divx.com/divx/autoupdate/player/" "DivXWebPlayerInstaller.exe" }, - { "realplayer", "RealPlayer", "RealPlayer", kRealPlayerVersionRange, - arraysize(kRealPlayerVersionRange), - "http://www.real.com/realplayer" }, // These are here for grouping, no vulnerabilities known. { "windows-media-player", "Windows Media Player", "Windows Media Player", NULL, 0, "" }, { "microsoft-office", "Microsoft Office", "Microsoft Office", NULL, 0, "" }, + // TODO(panayiotis): The vulnerable versions are + // (v >= 6.0.12.1040 && v <= 6.0.12.1663) + // || v == 6.0.12.1698 || v == 6.0.12.1741 + { "realplayer", "RealPlayer", "RealPlayer", NULL, 0, + "www.real.com/realplayer/downloads" }, }; #else @@ -778,4 +781,5 @@ void PluginList::Shutdown() { #endif } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/plugins/npapi/plugin_list.h b/webkit/plugins/npapi/plugin_list.h new file mode 100644 index 0000000..94124a2 --- /dev/null +++ b/webkit/plugins/npapi/plugin_list.h @@ -0,0 +1,339 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_LIST_H_ +#define WEBKIT_PLUGINS_NPAPI_PLUGIN_LIST_H_ + +#include <set> +#include <string> +#include <vector> + +#include "base/basictypes.h" +#include "base/file_path.h" +#include "base/linked_ptr.h" +#include "base/lock.h" +#include "third_party/npapi/bindings/nphostapi.h" +#include "webkit/plugins/npapi/plugin_group.h" +#include "webkit/plugins/npapi/webplugininfo.h" + +class GURL; + +namespace base { + +template <typename T> +struct DefaultLazyInstanceTraits; + +} // namespace base + +namespace webkit { +namespace npapi { + +extern FilePath::CharType kDefaultPluginLibraryName[]; + +class PluginInstance; + +// This struct holds entry points into a plugin. The entry points are +// slightly different between Win/Mac and Unixes. +struct PluginEntryPoints { +#if !defined(OS_POSIX) || defined(OS_MACOSX) + NP_GetEntryPointsFunc np_getentrypoints; +#endif + NP_InitializeFunc np_initialize; + NP_ShutdownFunc np_shutdown; +}; + +// This struct fully describes a plugin. For external plugins, it's read in from +// the version info of the dll; For internal plugins, it's predefined and +// includes addresses of entry functions. (Yes, it's Win32 NPAPI-centric, but +// it'll do for holding descriptions of internal plugins cross-platform.) +struct PluginVersionInfo { + FilePath path; + // Info about the plugin itself. + std::wstring product_name; + std::wstring file_description; + std::wstring file_version; + // Info about the data types that the plugin supports. + std::wstring mime_types; + std::wstring file_extensions; + std::wstring type_descriptions; + // Entry points for internal plugins. Pointers are NULL for external plugins. + PluginEntryPoints entry_points; +}; + +// The PluginList is responsible for loading our NPAPI based plugins. It does +// so in whatever manner is appropriate for the platform. On Windows, it loads +// plugins from a known directory by looking for DLLs which start with "NP", +// and checking to see if they are valid NPAPI libraries. On the Mac, it walks +// the machine-wide and user plugin directories and loads anything that has +// the correct types. On Linux, it walks the plugin directories as well +// (e.g. /usr/lib/browser-plugins/). +// This object is thread safe. +class PluginList { + public: + // Gets the one instance of the PluginList. + static PluginList* Singleton(); + + // Returns true if we're in debug-plugin-loading mode. This is controlled + // by a command line switch. + static bool DebugPluginLoading(); + + static const PluginGroupDefinition* GetPluginGroupDefinitions(); + static size_t GetPluginGroupDefinitionsSize(); + + // Returns true iff the plugin list has been loaded already. + bool PluginsLoaded(); + + // Cause the plugin list to refresh next time they are accessed, regardless + // of whether they are already loaded. + void RefreshPlugins(); + + // Add/Remove an extra plugin to load when we actually do the loading. Must + // be called before the plugins have been loaded. + void AddExtraPluginPath(const FilePath& plugin_path); + void RemoveExtraPluginPath(const FilePath& plugin_path); + + // Same as above, but specifies a directory in which to search for plugins. + void AddExtraPluginDir(const FilePath& plugin_dir); + + // Register an internal plugin with the specified plugin information and + // function pointers. An internal plugin must be registered before it can + // be loaded using PluginList::LoadPlugin(). + void RegisterInternalPlugin(const PluginVersionInfo& info); + + // Removes a specified internal plugin from the list. The search will match + // on the path from the version info previously registered. + // + // This is generally only necessary for tests. + void UnregisterInternalPlugin(const FilePath& path); + + // Creates a WebPluginInfo structure given a plugin's path. On success + // returns true, with the information being put into "info". If it's an + // internal plugin, "entry_points" is filled in as well with a + // internally-owned PluginEntryPoints pointer. + // Returns false if the library couldn't be found, or if it's not a plugin. + bool ReadPluginInfo(const FilePath& filename, + WebPluginInfo* info, + const PluginEntryPoints** entry_points); + + // Populate a WebPluginInfo from a PluginVersionInfo. + static bool CreateWebPluginInfo(const PluginVersionInfo& pvi, + WebPluginInfo* info); + + // Shutdown all plugins. Should be called at process teardown. + void Shutdown(); + + // Get all the plugins. + void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins); + + // Get all the enabled plugins. + void GetEnabledPlugins(bool refresh, std::vector<WebPluginInfo>* plugins); + + // Returns a list in |info| containing plugins that are found for + // the given url and mime type (including disabled plugins, for + // which |info->enabled| is false). The mime type which corresponds + // to the URL is optionally returned back in |actual_mime_types| (if + // it is non-NULL), one for each of the plugin info objects found. + // The |allow_wildcard| parameter controls whether this function + // returns plugins which support wildcard mime types (* as the mime + // type). The |info| parameter is required to be non-NULL. The + // list is in order of "most desirable" to "least desirable", + // meaning that the default plugin is at the end of the list. + void GetPluginInfoArray(const GURL& url, + const std::string& mime_type, + bool allow_wildcard, + std::vector<WebPluginInfo>* info, + std::vector<std::string>* actual_mime_types); + + // Returns the first item from the list returned in GetPluginInfo in |info|. + // Returns true if it found a match. |actual_mime_type| may be NULL. + bool GetPluginInfo(const GURL& url, + const std::string& mime_type, + bool allow_wildcard, + WebPluginInfo* info, + std::string* actual_mime_type); + + // Get plugin info by plugin path (including disabled plugins). Returns true + // if the plugin is found and WebPluginInfo has been filled in |info|. + bool GetPluginInfoByPath(const FilePath& plugin_path, + WebPluginInfo* info); + + // Populates the given vector with all available plugin groups. + void GetPluginGroups(bool load_if_necessary, + std::vector<PluginGroup>* plugin_groups); + + // Returns the PluginGroup corresponding to the given WebPluginInfo. If no + // such group exists, it is created and added to the cache. + // Beware: when calling this from the Browser process, the group that the + // returned pointer points to might disappear suddenly. This happens when + // |RefreshPlugins()| is called and then |LoadPlugins()| is triggered by a + // call to |GetPlugins()|, |GetEnabledPlugins()|, |GetPluginInfoArray()|, + // |GetPluginInfoByPath()|, or |GetPluginGroups(true, _)|. It is the caller's + // responsibility to make sure this doesn't happen. + const PluginGroup* GetPluginGroup(const WebPluginInfo& web_plugin_info); + + // Returns the name of the PluginGroup with the given identifier. + // If no such group exists, an empty string is returned. + string16 GetPluginGroupName(std::string identifier); + + // Returns the identifier string of the PluginGroup corresponding to the given + // WebPluginInfo. If no such group exists, it is created and added to the + // cache. + std::string GetPluginGroupIdentifier(const WebPluginInfo& web_plugin_info); + + // Load a specific plugin with full path. + void LoadPlugin(const FilePath& filename, + std::vector<WebPluginInfo>* plugins); + + // Enable a specific plugin, specified by path. Returns |true| iff a plugin + // currently in the plugin list was actually enabled as a result; regardless + // of return value, if a plugin is found in the future with the given name, it + // will be enabled. Note that plugins are enabled by default as far as + // |PluginList| is concerned. + bool EnablePlugin(const FilePath& filename); + + // Disable a specific plugin, specified by path. Returns |true| iff a plugin + // currently in the plugin list was actually disabled as a result; regardless + // of return value, if a plugin is found in the future with the given name, it + // will be disabled. + bool DisablePlugin(const FilePath& filename); + + // Enable/disable a plugin group, specified by group_name. Returns |true| iff + // a plugin currently in the plugin list was actually enabled/disabled as a + // result; regardless of return value, if a plugin is found in the future with + // the given name, it will be enabled/disabled. Note that plugins are enabled + // by default as far as |PluginList| is concerned. + bool EnableGroup(bool enable, const string16& name); + + // Disable all plugins groups that are known to be outdated, according to + // the information hardcoded in PluginGroup, to make sure that they can't + // be loaded on a web page and instead show a UI to update to the latest + // version. + void DisableOutdatedPluginGroups(); + + ~PluginList(); + + private: + FRIEND_TEST_ALL_PREFIXES(PluginGroupTest, PluginGroupDefinition); + + // Constructors are private for singletons + PluginList(); + + // Creates PluginGroups for the static group definitions, and adds them to + // the PluginGroup cache of this PluginList. + void AddHardcodedPluginGroups(); + + // Adds the given WebPluginInfo to its corresponding group, creating it if + // necessary, and returns the group. + // Callers need to protect calls to this method by a lock themselves. + PluginGroup* AddToPluginGroups(const WebPluginInfo& web_plugin_info); + + // Load all plugins from the default plugins directory + void LoadPlugins(bool refresh); + + // Load all plugins from a specific directory. + // |plugins| is updated with loaded plugin information. + // |visited_plugins| is updated with paths to all plugins that were considered + // (including those we didn't load) + void LoadPluginsFromDir(const FilePath& path, + std::vector<WebPluginInfo>* plugins, + std::set<FilePath>* visited_plugins); + + // Returns true if we should load the given plugin, or false otherwise. + // plugins is the list of plugins we have crawled in the current plugin + // loading run. + bool ShouldLoadPlugin(const WebPluginInfo& info, + std::vector<WebPluginInfo>* plugins); + + // Return whether a plug-in group with the given name should be disabled, + // either because it already is on the list of disabled groups, or because it + // is blacklisted by a policy. In the latter case, add the plugin group to the + // list of disabled groups as well. + bool ShouldDisableGroup(const string16& group_name); + + // Returns true if the given WebPluginInfo supports "mime-type". + // mime_type should be all lower case. + static bool SupportsType(const WebPluginInfo& info, + const std::string &mime_type, + bool allow_wildcard); + + // Returns true if the given WebPluginInfo supports a given file extension. + // extension should be all lower case. + // If mime_type is not NULL, it will be set to the mime type if found. + // The mime type which corresponds to the extension is optionally returned + // back. + static bool SupportsExtension(const WebPluginInfo& info, + const std::string &extension, + std::string* actual_mime_type); + + // + // Platform functions + // + + // Do any initialization. + void PlatformInit(); + + // Get the ordered list of directories from which to load plugins + void GetPluginDirectories(std::vector<FilePath>* plugin_dirs); + + // + // Command-line switches + // + +#if defined(OS_WIN) + // true if we shouldn't load the new WMP plugin. + bool dont_load_new_wmp_; + + // Loads plugins registered under HKCU\Software\MozillaPlugins and + // HKLM\Software\MozillaPlugins. + void LoadPluginsFromRegistry(std::vector<WebPluginInfo>* plugins, + std::set<FilePath>* visited_plugins); +#endif + + // + // Internals + // + + bool plugins_loaded_; + + // If true, we reload plugins even if they've been loaded already. + bool plugins_need_refresh_; + + // Contains information about the available plugins. + std::vector<WebPluginInfo> plugins_; + + // Extra plugin paths that we want to search when loading. + std::vector<FilePath> extra_plugin_paths_; + + // Extra plugin directories that we want to search when loading. + std::vector<FilePath> extra_plugin_dirs_; + + // Holds information about internal plugins. + std::vector<PluginVersionInfo> internal_plugins_; + + // Path names of plugins to disable (the default is to enable them all). + std::set<FilePath> disabled_plugins_; + + // Group names to disable (the default is to enable them all). + std::set<string16> disabled_groups_; + + bool disable_outdated_plugins_; + + // Holds the currently available plugin groups. + PluginGroup::PluginMap plugin_groups_; + + int next_priority_; + + // Need synchronization for the above members since this object can be + // accessed on multiple threads. + Lock lock_; + + friend struct base::DefaultLazyInstanceTraits<PluginList>; + + DISALLOW_COPY_AND_ASSIGN(PluginList); +}; + +} // namespace npapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_LIST_H_ diff --git a/webkit/glue/plugins/plugin_list_mac.mm b/webkit/plugins/npapi/plugin_list_mac.mm index e7a2337..049fe4d 100644 --- a/webkit/glue/plugins/plugin_list_mac.mm +++ b/webkit/plugins/npapi/plugin_list_mac.mm @@ -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/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" #import <Foundation/Foundation.h> @@ -12,7 +12,10 @@ #include "base/string_split.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "webkit/glue/plugins/plugin_lib.h" +#include "webkit/plugins/npapi/plugin_lib.h" + +namespace webkit { +namespace npapi { namespace { @@ -62,9 +65,6 @@ bool IsBlacklistedPlugin(const WebPluginInfo& info) { } // namespace -namespace NPAPI -{ - void PluginList::PlatformInit() { } @@ -106,4 +106,5 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, return true; } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_list_posix.cc b/webkit/plugins/npapi/plugin_list_posix.cc index 654c0c5..fd5e5b7 100644 --- a/webkit/glue/plugins/plugin_list_posix.cc +++ b/webkit/plugins/npapi/plugin_list_posix.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/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" #include "base/file_util.h" #include "base/path_service.h" @@ -11,6 +11,9 @@ #include "base/string_util.h" #include "build/build_config.h" +namespace webkit { +namespace npapi { + namespace { // We build up a list of files and mtimes so we can sort them. @@ -100,9 +103,7 @@ bool IsBlacklistedPlugin(const FilePath& path) { return IsBlacklistedBySha1sum(path); } -} // anonymous namespace - -namespace NPAPI { +} // namespace void PluginList::PlatformInit() { } @@ -267,4 +268,5 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, return true; } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_list_win.cc b/webkit/plugins/npapi/plugin_list_win.cc index 4869262..d7f13ef 100644 --- a/webkit/glue/plugins/plugin_list_win.cc +++ b/webkit/plugins/npapi/plugin_list_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/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" #include <tchar.h> @@ -17,29 +17,33 @@ #include "base/string_split.h" #include "base/string_util.h" #include "base/win/registry.h" -#include "webkit/glue/plugins/plugin_constants_win.h" -#include "webkit/glue/plugins/plugin_lib.h" +#include "webkit/plugins/npapi/plugin_constants_win.h" +#include "webkit/plugins/npapi/plugin_lib.h" +#include "webkit/plugins/plugin_switches.h" #include "webkit/glue/webkit_glue.h" +namespace webkit { +namespace npapi { + namespace { -const TCHAR kRegistryApps[] = - _T("Software\\Microsoft\\Windows\\CurrentVersion\\App Paths"); -const TCHAR kRegistryFirefox[] = _T("firefox.exe"); -const TCHAR kRegistryAcrobat[] = _T("Acrobat.exe"); -const TCHAR kRegistryAcrobatReader[] = _T("AcroRd32.exe"); -const TCHAR kRegistryWindowsMedia[] = _T("wmplayer.exe"); -const TCHAR kRegistryQuickTime[] = _T("QuickTimePlayer.exe"); -const TCHAR kRegistryPath[] = _T("Path"); -const TCHAR kRegistryFirefoxInstalled[] = - _T("SOFTWARE\\Mozilla\\Mozilla Firefox"); -const TCHAR kRegistryJava[] = - _T("Software\\JavaSoft\\Java Runtime Environment"); -const TCHAR kRegistryBrowserJavaVersion[] = _T("BrowserJavaVersion"); -const TCHAR kRegistryCurrentJavaVersion[] = _T("CurrentVersion"); -const TCHAR kRegistryJavaHome[] = _T("JavaHome"); -const TCHAR kJavaDeploy1[] = _T("npdeploytk.dll"); -const TCHAR kJavaDeploy2[] = _T("npdeployjava1.dll"); +const char16 kRegistryApps[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths"; +const char16 kRegistryFirefox[] = L"firefox.exe"; +const char16 kRegistryAcrobat[] = L"Acrobat.exe"; +const char16 kRegistryAcrobatReader[] = L"AcroRd32.exe"; +const char16 kRegistryWindowsMedia[] = L"wmplayer.exe"; +const char16 kRegistryQuickTime[] = L"QuickTimePlayer.exe"; +const char16 kRegistryPath[] = L"Path"; +const char16 kRegistryFirefoxInstalled[] = + L"SOFTWARE\\Mozilla\\Mozilla Firefox"; +const char16 kRegistryJava[] = + L"Software\\JavaSoft\\Java Runtime Environment"; +const char16 kRegistryBrowserJavaVersion[] = L"BrowserJavaVersion"; +const char16 kRegistryCurrentJavaVersion[] = L"CurrentVersion"; +const char16 kRegistryJavaHome[] = L"JavaHome"; +const char16 kJavaDeploy1[] = L"npdeploytk.dll"; +const char16 kJavaDeploy2[] = L"npdeployjava1.dll"; // The application path where we expect to find plugins. void GetAppDirectory(std::set<FilePath>* plugin_dirs) { @@ -62,7 +66,7 @@ void GetExeDirectory(std::set<FilePath>* plugin_dirs) { } // Gets the installed path for a registered app. -bool GetInstalledPath(const TCHAR* app, FilePath* out) { +bool GetInstalledPath(const char16* app, FilePath* out) { std::wstring reg_path(kRegistryApps); reg_path.append(L"\\"); reg_path.append(app); @@ -210,11 +214,9 @@ void GetJavaDirectory(std::set<FilePath>* plugin_dirs) { } // anonymous namespace -namespace NPAPI { - void PluginList::PlatformInit() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - dont_load_new_wmp_ = command_line.HasSwitch(kUseOldWMPPluginSwitch); + dont_load_new_wmp_ = command_line.HasSwitch(switches::kUseOldWMPPlugin); } void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) { @@ -407,4 +409,5 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, return true; } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_stream.cc b/webkit/plugins/npapi/plugin_stream.cc index e465e2d..fee63eb 100644 --- a/webkit/glue/plugins/plugin_stream.cc +++ b/webkit/plugins/npapi/plugin_stream.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,16 +6,17 @@ // TODO : Support NP_SEEK mode // TODO : Support SEEKABLE=true in NewStream -#include "webkit/glue/plugins/plugin_stream.h" +#include "webkit/plugins/npapi/plugin_stream.h" #include "base/message_loop.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "net/base/mime_util.h" -#include "webkit/glue/plugins/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_instance.h" #include "googleurl/src/gurl.h" -namespace NPAPI { +namespace webkit { +namespace npapi { PluginStream::~PluginStream() { // always close our temporary files. @@ -244,7 +245,7 @@ bool PluginStream::Close(NPReason reason) { return true; } -webkit_glue::WebPluginResourceClient* PluginStream::AsResourceClient() { +WebPluginResourceClient* PluginStream::AsResourceClient() { return NULL; } @@ -255,4 +256,5 @@ void PluginStream::Notify(NPReason reason) { } } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_stream.h b/webkit/plugins/npapi/plugin_stream.h index c5975b4..040e4fe 100644 --- a/webkit/glue/plugins/plugin_stream.h +++ b/webkit/plugins/npapi/plugin_stream.h @@ -2,27 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_PLUGIN_STREAM_H_ -#define WEBKIT_GLUE_PLUGINS_PLUGIN_STREAM_H_ - -#include "build/build_config.h" +#ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_STREAM_H_ +#define WEBKIT_PLUGINS_NPAPI_PLUGIN_STREAM_H_ #include <string> #include <vector> -#if defined(OS_POSIX) #include "base/file_path.h" -#endif #include "base/ref_counted.h" +#include "build/build_config.h" #include "third_party/npapi/bindings/npapi.h" -namespace webkit_glue { -class WebPluginResourceClient; -} - -namespace NPAPI { +namespace webkit { +namespace npapi { class PluginInstance; +class WebPluginResourceClient; // Base class for a NPAPI stream. Tracks basic elements // of a stream for NPAPI notifications and stream position. @@ -64,7 +59,7 @@ class PluginStream : public base::RefCounted<PluginStream> { // Close the stream. virtual bool Close(NPReason reason); - virtual webkit_glue::WebPluginResourceClient* AsResourceClient(); + virtual WebPluginResourceClient* AsResourceClient(); // Cancels any HTTP requests initiated by the stream. virtual void CancelRequest() {} @@ -151,6 +146,7 @@ class PluginStream : public base::RefCounted<PluginStream> { DISALLOW_COPY_AND_ASSIGN(PluginStream); }; -} // namespace NPAPI +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_PLUGINS_PLUGIN_STREAM_H_ +#endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_STREAM_H_ diff --git a/webkit/glue/plugins/plugin_stream_posix.cc b/webkit/plugins/npapi/plugin_stream_posix.cc index d0e2291..7a89ff1 100644 --- a/webkit/glue/plugins/plugin_stream_posix.cc +++ b/webkit/plugins/npapi/plugin_stream_posix.cc @@ -2,16 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/plugin_stream.h" +#include "webkit/plugins/npapi/plugin_stream.h" #include <string.h> #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" -#include "webkit/glue/plugins/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_instance.h" -namespace NPAPI { +namespace webkit { +namespace npapi { PluginStream::PluginStream( PluginInstance *instance, @@ -71,4 +72,5 @@ bool PluginStream::TempFileIsValid() { return temp_file_ != NULL; } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_stream_url.cc b/webkit/plugins/npapi/plugin_stream_url.cc index 7f9f355..b7efcdf 100644 --- a/webkit/glue/plugins/plugin_stream_url.cc +++ b/webkit/plugins/npapi/plugin_stream_url.cc @@ -2,15 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/plugin_stream_url.h" +#include "webkit/plugins/npapi/plugin_stream_url.h" #include "net/http/http_response_headers.h" -#include "webkit/glue/plugins/plugin_host.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/plugin_lib.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/plugin_host.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_lib.h" +#include "webkit/plugins/npapi/webplugin.h" -namespace NPAPI { +namespace webkit { +namespace npapi { PluginStreamUrl::PluginStreamUrl( unsigned long resource_id, @@ -39,8 +40,8 @@ bool PluginStreamUrl::Close(NPReason reason) { return result; } -webkit_glue::WebPluginResourceClient* PluginStreamUrl::AsResourceClient() { - return static_cast<webkit_glue::WebPluginResourceClient*>(this); +WebPluginResourceClient* PluginStreamUrl::AsResourceClient() { + return static_cast<WebPluginResourceClient*>(this); } void PluginStreamUrl::WillSendRequest(const GURL& url, int http_status_code) { @@ -127,4 +128,5 @@ void PluginStreamUrl::CancelRequest() { } } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_stream_url.h b/webkit/plugins/npapi/plugin_stream_url.h index 8642897..312f8de 100644 --- a/webkit/glue/plugins/plugin_stream_url.h +++ b/webkit/plugins/npapi/plugin_stream_url.h @@ -2,21 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__ -#define WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__ +#ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_STREAM_URL_H_ +#define WEBKIT_PLUGINS_NPAPI_PLUGIN_STREAM_URL_H_ - -#include "webkit/glue/plugins/plugin_stream.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/plugin_stream.h" +#include "webkit/plugins/npapi/webplugin.h" #include "googleurl/src/gurl.h" -namespace NPAPI { +namespace webkit { +namespace npapi { class PluginInstance; // A NPAPI Stream based on a URL. class PluginStreamUrl : public PluginStream, - public webkit_glue::WebPluginResourceClient { + public WebPluginResourceClient { public: // Create a new stream for sending to the plugin by fetching // a URL. If notifyNeeded is set, then the plugin will be notified @@ -34,7 +34,7 @@ class PluginStreamUrl : public PluginStream, // it is still loading. virtual bool Close(NPReason reason); - virtual webkit_glue::WebPluginResourceClient* AsResourceClient(); + virtual WebPluginResourceClient* AsResourceClient(); virtual void CancelRequest(); @@ -60,6 +60,7 @@ class PluginStreamUrl : public PluginStream, DISALLOW_COPY_AND_ASSIGN(PluginStreamUrl); }; -} // namespace NPAPI +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__ +#endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_STREAM_URL_H_ diff --git a/webkit/glue/plugins/plugin_stream_win.cc b/webkit/plugins/npapi/plugin_stream_win.cc index 0b6fcbd..edc9770 100644 --- a/webkit/glue/plugins/plugin_stream_win.cc +++ b/webkit/plugins/npapi/plugin_stream_win.cc @@ -1,13 +1,14 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/plugin_stream.h" +#include "webkit/plugins/npapi/plugin_stream.h" #include "base/logging.h" -#include "webkit/glue/plugins/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_instance.h" -namespace NPAPI { +namespace webkit { +namespace npapi { PluginStream::PluginStream( PluginInstance *instance, @@ -94,4 +95,5 @@ bool PluginStream::TempFileIsValid() { return temp_file_handle_ != INVALID_HANDLE_VALUE; } -} // namespace NPAPI +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_string_stream.cc b/webkit/plugins/npapi/plugin_string_stream.cc index f174267..d38b4c1 100644 --- a/webkit/glue/plugins/plugin_string_stream.cc +++ b/webkit/plugins/npapi/plugin_string_stream.cc @@ -1,12 +1,13 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/plugin_string_stream.h" +#include "webkit/plugins/npapi/plugin_string_stream.h" #include "googleurl/src/gurl.h" -namespace NPAPI { +namespace webkit { +namespace npapi { PluginStringStream::PluginStringStream( PluginInstance* instance, @@ -34,4 +35,5 @@ void PluginStringStream::SendToPlugin(const std::string &data, } } -} +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/plugin_string_stream.h b/webkit/plugins/npapi/plugin_string_stream.h index 68db2bf..1fdeea2 100644 --- a/webkit/glue/plugins/plugin_string_stream.h +++ b/webkit/plugins/npapi/plugin_string_stream.h @@ -2,14 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_STRING_STREAM_H_ -#define WEBKIT_GLUE_PLUGIN_PLUGIN_STRING_STREAM_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_STRING_STREAM_H_ +#define WEBKIT_PLUGINS_NPAPI_PLUGIN_STRING_STREAM_H_ -#include "webkit/glue/plugins/plugin_stream.h" +#include "webkit/plugins/npapi/plugin_stream.h" class GURL; -namespace NPAPI { +namespace webkit { +namespace npapi { class PluginInstance; @@ -34,6 +35,8 @@ class PluginStringStream : public PluginStream { DISALLOW_COPY_AND_ASSIGN(PluginStringStream); }; -} // namespace NPAPI -#endif // WEBKIT_GLUE_PLUGIN_PLUGIN_STRING_STREAM_H_ +} // namespace npapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_STRING_STREAM_H_ diff --git a/webkit/glue/plugins/plugin_web_event_converter_mac.h b/webkit/plugins/npapi/plugin_web_event_converter_mac.h index ec5b86f..a525428 100644 --- a/webkit/glue/plugins/plugin_web_event_converter_mac.h +++ b/webkit/plugins/npapi/plugin_web_event_converter_mac.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_ -#define WEBKIT_GLUE_PLUGIN_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_ +#define WEBKIT_PLUGINS_NPAPI_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_ #include "third_party/npapi/bindings/npapi.h" @@ -14,6 +14,9 @@ class WebMouseEvent; class WebMouseWheelEvent; } +namespace webkit { +namespace npapi { + // Utility class to translating WebInputEvent structs to equivalent structures // suitable for sending to Mac plugins (via NPP_HandleEvent). class PluginWebEventConverter { @@ -31,7 +34,7 @@ class PluginWebEventConverter { // Returns NULL iff InitWithEvent returned false. virtual void* plugin_event() = 0; -protected: + protected: // To be overridden by subclasses to store a converted plugin representation // of the given web event, suitable for returning from plugin_event. // Returns true if the event was successfully converted. @@ -57,4 +60,7 @@ class PluginWebEventConverterFactory { DISALLOW_COPY_AND_ASSIGN(PluginWebEventConverterFactory); }; -#endif // WEBKIT_GLUE_PLUGIN_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_ +} // namespace npapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_WEB_EVENT_CONVERTER_MAC_H_ diff --git a/webkit/glue/plugins/plugin_web_event_converter_mac.mm b/webkit/plugins/npapi/plugin_web_event_converter_mac.mm index 12d5cc6..ba45f2e 100644 --- a/webkit/glue/plugins/plugin_web_event_converter_mac.mm +++ b/webkit/plugins/npapi/plugin_web_event_converter_mac.mm @@ -5,7 +5,7 @@ #import <Cocoa/Cocoa.h> #include "base/logging.h" -#include "webkit/glue/plugins/plugin_web_event_converter_mac.h" +#include "webkit/plugins/npapi/plugin_web_event_converter_mac.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" using WebKit::WebInputEvent; @@ -13,6 +13,9 @@ using WebKit::WebKeyboardEvent; using WebKit::WebMouseEvent; using WebKit::WebMouseWheelEvent; +namespace webkit { +namespace npapi { + namespace { // Returns true if the caps lock flag should be set for the given event. @@ -357,3 +360,6 @@ PluginWebEventConverter* return NULL; } } + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/quickdraw_drawing_manager_mac.cc b/webkit/plugins/npapi/quickdraw_drawing_manager_mac.cc index 424cc1e..26db55d 100644 --- a/webkit/glue/plugins/quickdraw_drawing_manager_mac.cc +++ b/webkit/plugins/npapi/quickdraw_drawing_manager_mac.cc @@ -4,15 +4,18 @@ #ifndef NP_NO_QUICKDRAW -#include "webkit/glue/plugins/quickdraw_drawing_manager_mac.h" +#include "webkit/plugins/npapi/quickdraw_drawing_manager_mac.h" -#include "webkit/glue/plugins/coregraphics_private_symbols_mac.h" +#include "webkit/plugins/npapi/coregraphics_private_symbols_mac.h" // Turn off GCC warnings about deprecated functions (since QuickDraw is a // deprecated API). According to the GCC documentation, this can only be done // per file, not pushed and popped like some options can be. #pragma GCC diagnostic ignored "-Wdeprecated-declarations" +namespace webkit { +namespace npapi { + QuickDrawDrawingManager::QuickDrawDrawingManager() : plugin_window_(NULL), target_context_(NULL), fast_path_enabled_(false), current_port_(NULL), target_world_(NULL), plugin_world_(NULL) {} @@ -151,4 +154,7 @@ void QuickDrawDrawingManager::CopyGWorldBits(GWorldPtr source, GWorldPtr dest, } } +} // namespace npapi +} // namespace webkit + #endif // !NP_NO_QUICKDRAW diff --git a/webkit/glue/plugins/quickdraw_drawing_manager_mac.h b/webkit/plugins/npapi/quickdraw_drawing_manager_mac.h index 8163f92..02d04d9 100644 --- a/webkit/glue/plugins/quickdraw_drawing_manager_mac.h +++ b/webkit/plugins/npapi/quickdraw_drawing_manager_mac.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_QUICKDRAW_DRAWING_MANAGER_MAC_H_ -#define WEBKIT_GLUE_QUICKDRAW_DRAWING_MANAGER_MAC_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_QUICKDRAW_DRAWING_MANAGER_MAC_H_ +#define WEBKIT_PLUGINS_NPAPI_QUICKDRAW_DRAWING_MANAGER_MAC_H_ #ifndef NP_NO_QUICKDRAW @@ -11,6 +11,9 @@ #include "gfx/rect.h" +namespace webkit { +namespace npapi { + // Plugin helper class encapsulating the details of capturing what a QuickDraw // drawing model plugin draws, then drawing it into a CGContext. class QuickDrawDrawingManager { @@ -78,6 +81,9 @@ class QuickDrawDrawingManager { GWorldPtr plugin_world_; // Created lazily; may be NULL. }; +} // namespace npapi +} // namespace webkit + #endif // !NP_NO_QUICKDRAW -#endif // QUICKDRAW_DRAWING_MANAGER_MAC +#endif // WEBKIT_PLUGINS_NPAPI_QUICKDRAW_DRAWING_MANAGER_MAC_H_ diff --git a/webkit/glue/plugins/test/Info.plist b/webkit/plugins/npapi/test/Info.plist index 37145fd..37145fd 100644 --- a/webkit/glue/plugins/test/Info.plist +++ b/webkit/plugins/npapi/test/Info.plist diff --git a/webkit/glue/plugins/test/npapi_constants.cc b/webkit/plugins/npapi/test/npapi_constants.cc index 75cc68f..94d3284 100644 --- a/webkit/glue/plugins/test/npapi_constants.cc +++ b/webkit/plugins/npapi/test/npapi_constants.cc @@ -1,10 +1,12 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/npapi_constants.h" +#include "webkit/plugins/npapi/test/npapi_constants.h" namespace NPAPIClient { + const char kTestCompleteCookie[] = "status"; const char kTestCompleteSuccess[] = "OK"; -} + +} // namespace NPAPIClient diff --git a/webkit/glue/plugins/test/npapi_constants.h b/webkit/plugins/npapi/test/npapi_constants.h index 6570c35..2d375b0 100644 --- a/webkit/glue/plugins/test/npapi_constants.h +++ b/webkit/plugins/npapi/test/npapi_constants.h @@ -1,13 +1,14 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Constants for the NPAPI test -#ifndef WEBKIT_PORT_PLUGINS_TEST_NPAPI_CONSTANTS_H__ -#define WEBKIT_PORT_PLUGINS_TEST_NPAPI_CONSTANTS_H__ +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_NPAPI_CONSTANTS_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_NPAPI_CONSTANTS_H_ namespace NPAPIClient { + // The name of the cookie which will be used to communicate between // the plugin and the test harness. extern const char kTestCompleteCookie[]; @@ -15,5 +16,7 @@ extern const char kTestCompleteCookie[]; // The cookie value which will be sent to the client upon successful // test. extern const char kTestCompleteSuccess[]; -} -#endif // WEBKIT_PORT_PLUGINS_TEST_NPAPI_CONSTANTS_H__ + +} // namespace NPAPIClient + +#endif // WEBKIT_PLUGINS_NPAPI_TEST_NPAPI_CONSTANTS_H_ diff --git a/webkit/glue/plugins/test/npapi_test.cc b/webkit/plugins/npapi/test/npapi_test.cc index 895a842..26dc45d 100644 --- a/webkit/glue/plugins/test/npapi_test.cc +++ b/webkit/plugins/npapi/test/npapi_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -53,7 +53,7 @@ #define EXPORT #endif -#include "webkit/glue/plugins/test/plugin_client.h" +#include "webkit/plugins/npapi/test/plugin_client.h" #if defined(OS_WIN) BOOL API_CALL DllMain(HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) { diff --git a/webkit/glue/plugins/test/npapi_test.def b/webkit/plugins/npapi/test/npapi_test.def index 4481c16..4481c16 100644 --- a/webkit/glue/plugins/test/npapi_test.def +++ b/webkit/plugins/npapi/test/npapi_test.def diff --git a/webkit/glue/plugins/test/npapi_test.rc b/webkit/plugins/npapi/test/npapi_test.rc index 524dda4..524dda4 100644 --- a/webkit/glue/plugins/test/npapi_test.rc +++ b/webkit/plugins/npapi/test/npapi_test.rc diff --git a/webkit/glue/plugins/test/plugin_arguments_test.cc b/webkit/plugins/npapi/test/plugin_arguments_test.cc index 46ccf43..fe1e54e 100644 --- a/webkit/glue/plugins/test/plugin_arguments_test.cc +++ b/webkit/plugins/npapi/test/plugin_arguments_test.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "webkit/plugins/npapi/test/plugin_arguments_test.h" + #include "base/basictypes.h" #include "base/string_util.h" #include "base/stringprintf.h" -#include "webkit/glue/plugins/test/plugin_arguments_test.h" - namespace NPAPIClient { PluginArgumentsTest::PluginArgumentsTest(NPP id, @@ -66,4 +66,4 @@ NPError PluginArgumentsTest::SetWindow(NPWindow* pNPWindow) { return NPERR_NO_ERROR; } -} // namespace NPAPIClient +} // namespace NPAPIClient diff --git a/webkit/glue/plugins/test/plugin_arguments_test.h b/webkit/plugins/npapi/test/plugin_arguments_test.h index aa05f19..c2a0eaa 100644 --- a/webkit/glue/plugins/test/plugin_arguments_test.h +++ b/webkit/plugins/npapi/test/plugin_arguments_test.h @@ -1,11 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_PORT_PLUGINS_TEST_PLUGIN_ARGUMENTS_TEST_H__ -#define WEBKIT_PORT_PLUGINS_TEST_PLUGIN_ARGUMENTS_TEST_H__ +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_ARGUMENTS_TEST_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_ARGUMENTS_TEST_H_ -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -38,6 +38,6 @@ class PluginArgumentsTest : public PluginTest { virtual NPError SetWindow(NPWindow* pNPWindow); }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_PORT_PLUGINS_TEST_PLUGIN_ARGUMENTS_TEST_H__ +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_ARGUMENTS_TEST_H_ diff --git a/webkit/glue/plugins/test/plugin_client.cc b/webkit/plugins/npapi/test/plugin_client.cc index 8358340..0b28250 100644 --- a/webkit/glue/plugins/test/plugin_client.cc +++ b/webkit/plugins/npapi/test/plugin_client.cc @@ -1,12 +1,12 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_client.h" +#include "webkit/plugins/npapi/test/plugin_client.h" #include "base/string_util.h" -#include "webkit/glue/plugins/test/plugin_test.h" -#include "webkit/glue/plugins/test/plugin_test_factory.h" +#include "webkit/plugins/npapi/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test_factory.h" namespace NPAPIClient { diff --git a/webkit/glue/plugins/test/plugin_client.h b/webkit/plugins/npapi/test/plugin_client.h index a6291b0..c06be2d 100644 --- a/webkit/glue/plugins/test/plugin_client.h +++ b/webkit/plugins/npapi/test/plugin_client.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_PORT_PLUGINS_TEST_PLUGIN_CLIENT_H__ -#define WEBKIT_PORT_PLUGINS_TEST_PLUGIN_CLIENT_H__ +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_CLIENT_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_CLIENT_H_ #include "third_party/npapi/bindings/npapi.h" #include "third_party/npapi/bindings/nphostapi.h" @@ -40,6 +40,6 @@ class PluginClient { static NPNetscapeFuncs* host_functions_; }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_PORT_PLUGINS_TEST_PLUGIN_CLIENT_H__ +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_CLIENT_H_ diff --git a/webkit/glue/plugins/test/plugin_create_instance_in_paint.cc b/webkit/plugins/npapi/test/plugin_create_instance_in_paint.cc index f98f89b..09d6bdc 100644 --- a/webkit/glue/plugins/test/plugin_create_instance_in_paint.cc +++ b/webkit/plugins/npapi/test/plugin_create_instance_in_paint.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_create_instance_in_paint.h" +#include "webkit/plugins/npapi/test/plugin_create_instance_in_paint.h" -#include "webkit/glue/plugins/test/plugin_client.h" +#include "webkit/plugins/npapi/test/plugin_client.h" namespace NPAPIClient { diff --git a/webkit/glue/plugins/test/plugin_create_instance_in_paint.h b/webkit/plugins/npapi/test/plugin_create_instance_in_paint.h index 84d7a94..59f196f 100644 --- a/webkit/glue/plugins/test/plugin_create_instance_in_paint.h +++ b/webkit/plugins/npapi/test/plugin_create_instance_in_paint.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_CREATE_INSTANCE_IN_PAINT_H -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_CREATE_INSTANCE_IN_PAINT_H +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_CREATE_INSTANCE_IN_PAINT_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_CREATE_INSTANCE_IN_PAINT_H_ -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -28,6 +28,6 @@ class CreateInstanceInPaintTest : public PluginTest { bool created_; }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_CREATE_INSTANCE_IN_PAINT_H +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_CREATE_INSTANCE_IN_PAINT_H_ diff --git a/webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.cc b/webkit/plugins/npapi/test/plugin_delete_plugin_in_stream_test.cc index 15318b4..fad7992 100644 --- a/webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.cc +++ b/webkit/plugins/npapi/test/plugin_delete_plugin_in_stream_test.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h" +#include "webkit/plugins/npapi/test/plugin_delete_plugin_in_stream_test.h" -#include "webkit/glue/plugins/test/plugin_client.h" +#include "webkit/plugins/npapi/test/plugin_client.h" namespace NPAPIClient { diff --git a/webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h b/webkit/plugins/npapi/test/plugin_delete_plugin_in_stream_test.h index 418e976..dca9de3 100644 --- a/webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h +++ b/webkit/plugins/npapi/test/plugin_delete_plugin_in_stream_test.h @@ -1,11 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_DELETE_PLUGIN_IN_STREAM_TEST_H -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_DELETE_PLUGIN_IN_STREAM_TEST_H +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_DELETE_PLUGIN_IN_STREAM_TEST_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_DELETE_PLUGIN_IN_STREAM_TEST_H_ -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -25,6 +25,6 @@ class DeletePluginInStreamTest : public PluginTest { std::string self_url_; }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_DELETE_PLUGIN_IN_STREAM_TEST_H +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_DELETE_PLUGIN_IN_STREAM_TEST_H_ diff --git a/webkit/glue/plugins/test/plugin_get_javascript_url2_test.cc b/webkit/plugins/npapi/test/plugin_get_javascript_url2_test.cc index d17dced..e7595f2 100644 --- a/webkit/glue/plugins/test/plugin_get_javascript_url2_test.cc +++ b/webkit/plugins/npapi/test/plugin_get_javascript_url2_test.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_get_javascript_url2_test.h" +#include "webkit/plugins/npapi/test/plugin_get_javascript_url2_test.h" #include "base/basictypes.h" diff --git a/webkit/glue/plugins/test/plugin_get_javascript_url2_test.h b/webkit/plugins/npapi/test/plugin_get_javascript_url2_test.h index 557da76..b5c398e 100644 --- a/webkit/glue/plugins/test/plugin_get_javascript_url2_test.h +++ b/webkit/plugins/npapi/test/plugin_get_javascript_url2_test.h @@ -1,11 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_GET_JAVASCRIPT_URL2_H -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_GET_JAVASCRIPT_URL2_H +#ifndef WEBKIT_PLUGINS_NPAPI_PLUGINS_TEST_PLUGIN_GET_JAVASCRIPT_URL2_H_ +#define WEBKIT_PLUGINS_NPAPI_PLUGINS_TEST_PLUGIN_GET_JAVASCRIPT_URL2_H_ -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -33,6 +33,6 @@ class ExecuteGetJavascriptUrl2Test : public PluginTest { std::string self_url_; }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_GET_JAVASCRIPT_URL2_H +#endif // WEBKIT_PLUGINS_NPAPI_PLUGINS_TEST_PLUGIN_GET_JAVASCRIPT_URL2_H_ diff --git a/webkit/glue/plugins/test/plugin_get_javascript_url_test.cc b/webkit/plugins/npapi/test/plugin_get_javascript_url_test.cc index 50f5e5a..ea32fac 100644 --- a/webkit/glue/plugins/test/plugin_get_javascript_url_test.cc +++ b/webkit/plugins/npapi/test/plugin_get_javascript_url_test.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_get_javascript_url_test.h" +#include "webkit/plugins/npapi/test/plugin_get_javascript_url_test.h" #include "base/basictypes.h" diff --git a/webkit/glue/plugins/test/plugin_get_javascript_url_test.h b/webkit/plugins/npapi/test/plugin_get_javascript_url_test.h index 5c2540d..9aab3f9 100644 --- a/webkit/glue/plugins/test/plugin_get_javascript_url_test.h +++ b/webkit/plugins/npapi/test/plugin_get_javascript_url_test.h @@ -1,11 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_GET_JAVASCRIPT_URL_H -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_GET_JAVASCRIPT_URL_H +#ifndef WEBKIT_PLUGINS_NPAPI_PLUGINS_TEST_PLUGIN_GET_JAVASCRIPT_URL_H_ +#define WEBKIT_PLUGINS_NPAPI_PLUGINS_TEST_PLUGIN_GET_JAVASCRIPT_URL_H_ -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -42,6 +42,6 @@ class ExecuteGetJavascriptUrlTest : public PluginTest { #endif }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_GET_JAVASCRIPT_URL_H +#endif // WEBKIT_PLUGINS_NPAPI_PLUGINS_TEST_PLUGIN_GET_JAVASCRIPT_URL_H_ diff --git a/webkit/glue/plugins/test/plugin_geturl_test.cc b/webkit/plugins/npapi/test/plugin_geturl_test.cc index 5363a66..850a0b5 100644 --- a/webkit/glue/plugins/test/plugin_geturl_test.cc +++ b/webkit/plugins/npapi/test/plugin_geturl_test.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/glue/plugins/test/plugin_geturl_test.h" +#include "webkit/plugins/npapi/test/plugin_geturl_test.h" #include <stdio.h> diff --git a/webkit/glue/plugins/test/plugin_geturl_test.h b/webkit/plugins/npapi/test/plugin_geturl_test.h index df8d741..79c623b 100644 --- a/webkit/glue/plugins/test/plugin_geturl_test.h +++ b/webkit/plugins/npapi/test/plugin_geturl_test.h @@ -1,13 +1,13 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_PORT_PLUGINS_TEST_PLUGIN_GETURL_TEST_H__ -#define WEBKIT_PORT_PLUGINS_TEST_PLUGIN_GETURL_TEST_H__ +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_GETURL_TEST_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_GETURL_TEST_H_ #include <stdio.h> -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -56,6 +56,6 @@ class PluginGetURLTest : public PluginTest { std::string referrer_target_url_; }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_PORT_PLUGINS_TEST_PLUGIN_GETURL_TEST_H__ +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_GETURL_TEST_H_ diff --git a/webkit/glue/plugins/test/plugin_javascript_open_popup.cc b/webkit/plugins/npapi/test/plugin_javascript_open_popup.cc index 0f93bf4..583a55e 100644 --- a/webkit/glue/plugins/test/plugin_javascript_open_popup.cc +++ b/webkit/plugins/npapi/test/plugin_javascript_open_popup.cc @@ -1,14 +1,14 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "build/build_config.h" -#include "webkit/glue/plugins/test/plugin_javascript_open_popup.h" +#include "webkit/plugins/npapi/test/plugin_javascript_open_popup.h" #if defined(USE_X11) #include "third_party/npapi/bindings/npapi_x11.h" #endif -#include "webkit/glue/plugins/test/plugin_client.h" +#include "webkit/plugins/npapi/test/plugin_client.h" namespace NPAPIClient { diff --git a/webkit/glue/plugins/test/plugin_javascript_open_popup.h b/webkit/plugins/npapi/test/plugin_javascript_open_popup.h index 552397a..6381d25 100644 --- a/webkit/glue/plugins/test/plugin_javascript_open_popup.h +++ b/webkit/plugins/npapi/test/plugin_javascript_open_popup.h @@ -1,11 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_JAVASCRIPT_OPEN_POPUP_H -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_JAVASCRIPT_OPEN_POPUP_H +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_JAVASCRIPT_OPEN_POPUP_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_JAVASCRIPT_OPEN_POPUP_H_ -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -42,6 +42,6 @@ class ExecuteJavascriptPopupWindowTargetPluginTest : public PluginTest { bool test_completed_; }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_JAVASCRIPT_OPEN_POPUP_H +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_JAVASCRIPT_OPEN_POPUP_H_ diff --git a/webkit/glue/plugins/test/plugin_new_fails_test.cc b/webkit/plugins/npapi/test/plugin_new_fails_test.cc index 2feeec6..71cff01 100644 --- a/webkit/glue/plugins/test/plugin_new_fails_test.cc +++ b/webkit/plugins/npapi/test/plugin_new_fails_test.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_new_fails_test.h" +#include "webkit/plugins/npapi/test/plugin_new_fails_test.h" namespace NPAPIClient { @@ -15,4 +15,4 @@ NPError NewFailsTest::New(uint16 mode, int16 argc, const char* argn[], return NPERR_GENERIC_ERROR; } -} // namespace NPAPIClient +} // namespace NPAPIClient diff --git a/webkit/glue/plugins/test/plugin_new_fails_test.h b/webkit/plugins/npapi/test/plugin_new_fails_test.h index 1acf9e5..334323e 100644 --- a/webkit/glue/plugins/test/plugin_new_fails_test.h +++ b/webkit/plugins/npapi/test/plugin_new_fails_test.h @@ -1,11 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_PLUGIN_NEW_FAILS_TEST_H__ -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_PLUGIN_NEW_FAILS_TEST_H__ +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_PLUGIN_NEW_FAILS_TEST_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_PLUGIN_NEW_FAILS_TEST_H_ -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -16,6 +16,6 @@ class NewFailsTest : public PluginTest { const char* argv[], NPSavedData* saved); }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_PLUGIN_NPP_NEW_FAILS_TEST_H__ +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_PLUGIN_NPP_NEW_FAILS_TEST_H_ diff --git a/webkit/glue/plugins/test/plugin_npobject_lifetime_test.cc b/webkit/plugins/npapi/test/plugin_npobject_lifetime_test.cc index 4564506..f493238 100644 --- a/webkit/glue/plugins/test/plugin_npobject_lifetime_test.cc +++ b/webkit/plugins/npapi/test/plugin_npobject_lifetime_test.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_npobject_lifetime_test.h" +#include "webkit/plugins/npapi/test/plugin_npobject_lifetime_test.h" namespace NPAPIClient { diff --git a/webkit/glue/plugins/test/plugin_npobject_lifetime_test.h b/webkit/plugins/npapi/test/plugin_npobject_lifetime_test.h index 60d0314..12cf4e2 100644 --- a/webkit/glue/plugins/test/plugin_npobject_lifetime_test.h +++ b/webkit/plugins/npapi/test/plugin_npobject_lifetime_test.h @@ -1,12 +1,12 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_NPOBJECT_LIFETIME_TEST_H__ -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_NPOBJECT_LIFETIME_TEST_H__ +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_NPOBJECT_LIFETIME_TEST_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_NPOBJECT_LIFETIME_TEST_H_ #include "build/build_config.h" -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -77,6 +77,6 @@ class NPObjectDeletePluginInNPN_Evaluate : public PluginTest { DISALLOW_IMPLICIT_CONSTRUCTORS(NPObjectDeletePluginInNPN_Evaluate); }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_NPOBJECT_LIFETIME_TEST_H__ +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_NPOBJECT_LIFETIME_TEST_H_ diff --git a/webkit/glue/plugins/test/plugin_npobject_proxy_test.cc b/webkit/plugins/npapi/test/plugin_npobject_proxy_test.cc index 5b3a2ca..c9cd27f 100644 --- a/webkit/glue/plugins/test/plugin_npobject_proxy_test.cc +++ b/webkit/plugins/npapi/test/plugin_npobject_proxy_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,7 +9,7 @@ #define STRSAFE_NO_DEPRECATE #include <strsafe.h> #endif -#include "webkit/glue/plugins/test/plugin_npobject_proxy_test.h" +#include "webkit/plugins/npapi/test/plugin_npobject_proxy_test.h" namespace NPAPIClient { diff --git a/webkit/glue/plugins/test/plugin_npobject_proxy_test.h b/webkit/plugins/npapi/test/plugin_npobject_proxy_test.h index 3d14ddb..8585d0f 100644 --- a/webkit/glue/plugins/test/plugin_npobject_proxy_test.h +++ b/webkit/plugins/npapi/test/plugin_npobject_proxy_test.h @@ -1,11 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_NPOBJECT_PROXY_TEST_H__ -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_NPOBJECT_PROXY_TEST_H__ +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_NPOBJECT_PROXY_TEST_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_NPOBJECT_PROXY_TEST_H_ -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -22,6 +22,6 @@ class NPObjectProxyTest : public PluginTest { virtual NPError SetWindow(NPWindow* pNPWindow); }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_NPOBJECT_PROXY_TEST_H__ +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_NPOBJECT_PROXY_TEST_H_ diff --git a/webkit/glue/plugins/test/plugin_private_test.cc b/webkit/plugins/npapi/test/plugin_private_test.cc index cdab7ce..b3aabce 100644 --- a/webkit/glue/plugins/test/plugin_private_test.cc +++ b/webkit/plugins/npapi/test/plugin_private_test.cc @@ -1,12 +1,12 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_private_test.h" +#include "webkit/plugins/npapi/test/plugin_private_test.h" #include "base/basictypes.h" #include "base/string_util.h" -#include "webkit/glue/plugins/test/plugin_client.h" +#include "webkit/plugins/npapi/test/plugin_client.h" namespace NPAPIClient { diff --git a/webkit/glue/plugins/test/plugin_private_test.h b/webkit/plugins/npapi/test/plugin_private_test.h index db6b5d1..9079a11 100644 --- a/webkit/glue/plugins/test/plugin_private_test.h +++ b/webkit/plugins/npapi/test/plugin_private_test.h @@ -1,11 +1,11 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_PORT_PLUGINS_TEST_PLUGIN_PRIVATE_TEST_H_ -#define WEBKIT_PORT_PLUGINS_TEST_PLUGIN_PRIVATE_TEST_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_PRIVATE_TEST_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_PRIVATE_TEST_H_ -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -20,6 +20,6 @@ class PrivateTest : public PluginTest { const char* argv[], NPSavedData* saved); }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_PORT_PLUGINS_TEST_PLUGIN_PRIVATE_TEST_H_ +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_PRIVATE_TEST_H_ diff --git a/webkit/glue/plugins/test/plugin_schedule_timer_test.cc b/webkit/plugins/npapi/test/plugin_schedule_timer_test.cc index fbfce34..831ab29 100644 --- a/webkit/glue/plugins/test/plugin_schedule_timer_test.cc +++ b/webkit/plugins/npapi/test/plugin_schedule_timer_test.cc @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_schedule_timer_test.h" -#include "webkit/glue/plugins/test/plugin_client.h" +#include "webkit/plugins/npapi/test/plugin_schedule_timer_test.h" +#include "webkit/plugins/npapi/test/plugin_client.h" using base::Time; diff --git a/webkit/glue/plugins/test/plugin_schedule_timer_test.h b/webkit/plugins/npapi/test/plugin_schedule_timer_test.h index e3e6505a..043672c 100644 --- a/webkit/glue/plugins/test/plugin_schedule_timer_test.h +++ b/webkit/plugins/npapi/test/plugin_schedule_timer_test.h @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_SCHEDULE_TIMER_TEST_H -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_SCHEDULE_TIMER_TEST_H +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_SCHEDULE_TIMER_TEST_H +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_SCHEDULE_TIMER_TEST_H #include "base/at_exit.h" #include "base/time.h" -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -65,4 +65,4 @@ class ScheduleTimerTest : public PluginTest { } // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_SCHEDULE_TIMER_TEST_H +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_SCHEDULE_TIMER_TEST_H diff --git a/webkit/glue/plugins/test/plugin_setup_test.cc b/webkit/plugins/npapi/test/plugin_setup_test.cc index e4c4903..ded1379 100644 --- a/webkit/glue/plugins/test/plugin_setup_test.cc +++ b/webkit/plugins/npapi/test/plugin_setup_test.cc @@ -5,7 +5,7 @@ #include "base/basictypes.h" #include "base/string_util.h" -#include "webkit/glue/plugins/test/plugin_setup_test.h" +#include "webkit/plugins/npapi/test/plugin_setup_test.h" namespace NPAPIClient { @@ -19,4 +19,4 @@ NPError PluginSetupTest::SetWindow(NPWindow* pNPWindow) { return NPERR_NO_ERROR; } -} // namespace NPAPIClient +} // namespace NPAPIClient diff --git a/webkit/glue/plugins/test/plugin_setup_test.h b/webkit/plugins/npapi/test/plugin_setup_test.h index b01bc42..709b3b1 100644 --- a/webkit/glue/plugins/test/plugin_setup_test.h +++ b/webkit/plugins/npapi/test/plugin_setup_test.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_SETUP_TEST_H__ -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_SETUP_TEST_H__ +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_SETUP_TEST_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_SETUP_TEST_H_ -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -19,6 +19,6 @@ class PluginSetupTest : public PluginTest { virtual NPError SetWindow(NPWindow* pNPWindow); }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_SETUP_TEST_H__ +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_SETUP_TEST_H_ diff --git a/webkit/glue/plugins/test/plugin_test.cc b/webkit/plugins/npapi/test/plugin_test.cc index 6717e4b..c948010 100644 --- a/webkit/glue/plugins/test/plugin_test.cc +++ b/webkit/plugins/npapi/test/plugin_test.cc @@ -1,11 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" #include "base/string_util.h" -#include "webkit/glue/plugins/test/npapi_constants.h" +#include "webkit/plugins/npapi/test/npapi_constants.h" namespace NPAPIClient { diff --git a/webkit/glue/plugins/test/plugin_test.h b/webkit/plugins/npapi/test/plugin_test.h index f3f8937..fee09d3 100644 --- a/webkit/glue/plugins/test/plugin_test.h +++ b/webkit/plugins/npapi/test/plugin_test.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_PORT_PLUGINS_TEST_PLUGIN_TEST_H_ -#define WEBKIT_PORT_PLUGINS_TEST_PLUGIN_TEST_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_TEST_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_TEST_H_ #include <string> @@ -129,6 +129,6 @@ class PluginTest { bool test_completed_; }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_PORT_PLUGINS_TEST_PLUGIN_TEST_H_ +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_TEST_H_ diff --git a/webkit/glue/plugins/test/plugin_test_factory.cc b/webkit/plugins/npapi/test/plugin_test_factory.cc index b4ae4f1..779ad00 100644 --- a/webkit/glue/plugins/test/plugin_test_factory.cc +++ b/webkit/plugins/npapi/test/plugin_test_factory.cc @@ -2,26 +2,26 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_test_factory.h" +#include "webkit/plugins/npapi/test/plugin_test_factory.h" -#include "webkit/glue/plugins/test/plugin_arguments_test.h" -#include "webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h" -#include "webkit/glue/plugins/test/plugin_get_javascript_url_test.h" -#include "webkit/glue/plugins/test/plugin_get_javascript_url2_test.h" -#include "webkit/glue/plugins/test/plugin_geturl_test.h" -#include "webkit/glue/plugins/test/plugin_javascript_open_popup.h" -#include "webkit/glue/plugins/test/plugin_new_fails_test.h" -#include "webkit/glue/plugins/test/plugin_npobject_lifetime_test.h" -#include "webkit/glue/plugins/test/plugin_npobject_proxy_test.h" -#include "webkit/glue/plugins/test/plugin_private_test.h" -#include "webkit/glue/plugins/test/plugin_schedule_timer_test.h" -#include "webkit/glue/plugins/test/plugin_setup_test.h" -#include "webkit/glue/plugins/test/plugin_thread_async_call_test.h" -#include "webkit/glue/plugins/test/plugin_window_size_test.h" +#include "webkit/plugins/npapi/test/plugin_arguments_test.h" +#include "webkit/plugins/npapi/test/plugin_delete_plugin_in_stream_test.h" +#include "webkit/plugins/npapi/test/plugin_get_javascript_url_test.h" +#include "webkit/plugins/npapi/test/plugin_get_javascript_url2_test.h" +#include "webkit/plugins/npapi/test/plugin_geturl_test.h" +#include "webkit/plugins/npapi/test/plugin_javascript_open_popup.h" +#include "webkit/plugins/npapi/test/plugin_new_fails_test.h" +#include "webkit/plugins/npapi/test/plugin_npobject_lifetime_test.h" +#include "webkit/plugins/npapi/test/plugin_npobject_proxy_test.h" +#include "webkit/plugins/npapi/test/plugin_private_test.h" +#include "webkit/plugins/npapi/test/plugin_schedule_timer_test.h" +#include "webkit/plugins/npapi/test/plugin_setup_test.h" +#include "webkit/plugins/npapi/test/plugin_thread_async_call_test.h" +#include "webkit/plugins/npapi/test/plugin_window_size_test.h" #if defined(OS_WIN) -#include "webkit/glue/plugins/test/plugin_windowed_test.h" +#include "webkit/plugins/npapi/test/plugin_windowed_test.h" #endif -#include "webkit/glue/plugins/test/plugin_windowless_test.h" +#include "webkit/plugins/npapi/test/plugin_windowless_test.h" namespace NPAPIClient { diff --git a/webkit/glue/plugins/test/plugin_test_factory.h b/webkit/plugins/npapi/test/plugin_test_factory.h index 3fd38d5..f1ed661 100644 --- a/webkit/glue/plugins/test/plugin_test_factory.h +++ b/webkit/plugins/npapi/test/plugin_test_factory.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_PORT_PLUGINS_TEST_PLUGIN_TEST_FACTROY_H__ -#define WEBKIT_PORT_PLUGINS_TEST_PLUGIN_TEST_FACTROY_H__ +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_TEST_FACTROY_H__ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_TEST_FACTROY_H__ #include <string> @@ -19,4 +19,4 @@ extern PluginTest* CreatePluginTest(const std::string& test_name, } // namespace NPAPIClient -#endif // WEBKIT_PORT_PLUGINS_TEST_PLUGIN_TEST_FACTROY_H__ +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_TEST_FACTROY_H__ diff --git a/webkit/glue/plugins/test/plugin_thread_async_call_test.cc b/webkit/plugins/npapi/test/plugin_thread_async_call_test.cc index c01a49e..e28f84e 100644 --- a/webkit/glue/plugins/test/plugin_thread_async_call_test.cc +++ b/webkit/plugins/npapi/test/plugin_thread_async_call_test.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_thread_async_call_test.h" +#include "webkit/plugins/npapi/test/plugin_thread_async_call_test.h" #include "base/at_exit.h" #include "base/message_loop.h" #include "base/thread.h" -#include "webkit/glue/plugins/test/plugin_client.h" +#include "webkit/plugins/npapi/test/plugin_client.h" namespace NPAPIClient { diff --git a/webkit/glue/plugins/test/plugin_thread_async_call_test.h b/webkit/plugins/npapi/test/plugin_thread_async_call_test.h index 78e4e8d..9e6a011 100644 --- a/webkit/glue/plugins/test/plugin_thread_async_call_test.h +++ b/webkit/plugins/npapi/test/plugin_thread_async_call_test.h @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_THREAD_ASYNC_CALL_TEST_H_ -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_THREAD_ASYNC_CALL_TEST_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_THREAD_ASYNC_CALL_TEST_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_THREAD_ASYNC_CALL_TEST_H_ #include "base/scoped_ptr.h" -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace base { class AtExitManager; @@ -36,4 +36,4 @@ class PluginThreadAsyncCallTest : public PluginTest { } // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_THREAD_ASYNC_CALL_TEST_H_ +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_THREAD_ASYNC_CALL_TEST_H_ diff --git a/webkit/glue/plugins/test/plugin_window_size_test.cc b/webkit/plugins/npapi/test/plugin_window_size_test.cc index 9bfabca..abc08ad 100644 --- a/webkit/glue/plugins/test/plugin_window_size_test.cc +++ b/webkit/plugins/npapi/test/plugin_window_size_test.cc @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_window_size_test.h" -#include "webkit/glue/plugins/test/plugin_client.h" +#include "webkit/plugins/npapi/test/plugin_window_size_test.h" +#include "webkit/plugins/npapi/test/plugin_client.h" namespace NPAPIClient { diff --git a/webkit/glue/plugins/test/plugin_window_size_test.h b/webkit/plugins/npapi/test/plugin_window_size_test.h index 3650671..5a49479 100644 --- a/webkit/glue/plugins/test/plugin_window_size_test.h +++ b/webkit/plugins/npapi/test/plugin_window_size_test.h @@ -1,11 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_WINDOW_SIZE_TEST_H -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_WINDOW_SIZE_TEST_H +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_WINDOW_SIZE_TEST_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_WINDOW_SIZE_TEST_H_ -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -19,6 +19,6 @@ class PluginWindowSizeTest : public PluginTest { virtual NPError SetWindow(NPWindow* pNPWindow); }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_WINDOW_SIZE_TEST_H +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_WINDOW_SIZE_TEST_H_ diff --git a/webkit/glue/plugins/test/plugin_windowed_test.cc b/webkit/plugins/npapi/test/plugin_windowed_test.cc index c82aa55..5635ec5 100644 --- a/webkit/glue/plugins/test/plugin_windowed_test.cc +++ b/webkit/plugins/npapi/test/plugin_windowed_test.cc @@ -1,9 +1,9 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/test/plugin_windowed_test.h" -#include "webkit/glue/plugins/test/plugin_client.h" +#include "webkit/plugins/npapi/test/plugin_windowed_test.h" +#include "webkit/plugins/npapi/test/plugin_client.h" namespace NPAPIClient { diff --git a/webkit/glue/plugins/test/plugin_windowed_test.h b/webkit/plugins/npapi/test/plugin_windowed_test.h index 949ea86..4906933 100644 --- a/webkit/glue/plugins/test/plugin_windowed_test.h +++ b/webkit/plugins/npapi/test/plugin_windowed_test.h @@ -1,11 +1,11 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_WINDOWED_TEST_H -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_WINDOWED_TEST_H +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_WINDOWED_TEST_H +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_WINDOWED_TEST_H -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -28,6 +28,6 @@ class WindowedPluginTest : public PluginTest { bool done_; }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_WINDOWED_TEST_H +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_WINDOWED_TEST_H diff --git a/webkit/glue/plugins/test/plugin_windowless_test.cc b/webkit/plugins/npapi/test/plugin_windowless_test.cc index aa6a9d7..17b9ca7 100644 --- a/webkit/glue/plugins/test/plugin_windowless_test.cc +++ b/webkit/plugins/npapi/test/plugin_windowless_test.cc @@ -5,8 +5,8 @@ #define STRSAFE_NO_DEPRECATE #include "base/string_number_conversions.h" #include "base/string_util.h" -#include "webkit/glue/plugins/test/plugin_windowless_test.h" -#include "webkit/glue/plugins/test/plugin_client.h" +#include "webkit/plugins/npapi/test/plugin_windowless_test.h" +#include "webkit/plugins/npapi/test/plugin_client.h" #if defined(OS_MACOSX) #include <ApplicationServices/ApplicationServices.h> diff --git a/webkit/glue/plugins/test/plugin_windowless_test.h b/webkit/plugins/npapi/test/plugin_windowless_test.h index f336653..6f5ce15 100644 --- a/webkit/glue/plugins/test/plugin_windowless_test.h +++ b/webkit/plugins/npapi/test/plugin_windowless_test.h @@ -1,11 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_EXECUTE_SCRIPT_DELETE_TEST_H -#define WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_EXECUTE_SCRIPT_DELETE_TEST_H +#ifndef WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_EXECUTE_SCRIPT_DELETE_TEST_H_ +#define WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_EXECUTE_SCRIPT_DELETE_TEST_H_ -#include "webkit/glue/plugins/test/plugin_test.h" +#include "webkit/plugins/npapi/test/plugin_test.h" namespace NPAPIClient { @@ -30,6 +30,6 @@ class WindowlessPluginTest : public PluginTest { void ConvertPoint(NPNetscapeFuncs* browser); }; -} // namespace NPAPIClient +} // namespace NPAPIClient -#endif // WEBKIT_GLUE_PLUGINS_TEST_PLUGIN_EXECUTE_SCRIPT_DELETE_TEST_H +#endif // WEBKIT_PLUGINS_NPAPI_TEST_PLUGIN_EXECUTE_SCRIPT_DELETE_TEST_H_ diff --git a/webkit/glue/plugins/test/resource.h b/webkit/plugins/npapi/test/resource.h index c52fa82..422861f 100644 --- a/webkit/glue/plugins/test/resource.h +++ b/webkit/plugins/npapi/test/resource.h @@ -4,7 +4,7 @@ // // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 diff --git a/webkit/glue/plugins/webplugin.cc b/webkit/plugins/npapi/webplugin.cc index f780e18f..cfe2ff1 100644 --- a/webkit/glue/plugins/webplugin.cc +++ b/webkit/plugins/npapi/webplugin.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/webplugin.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { WebPluginGeometry::WebPluginGeometry() : window(gfx::kNullPluginWindow), @@ -28,4 +29,5 @@ WebPluginDelegate* WebPlugin::delegate() { return NULL; } -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin.h b/webkit/plugins/npapi/webplugin.h index 8a61027..c596949 100644 --- a/webkit/glue/plugins/webplugin.h +++ b/webkit/plugins/npapi/webplugin.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_WEBPLUGIN_H_ -#define WEBKIT_GLUE_WEBPLUGIN_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_H_ +#define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_H_ #include <string> #include <vector> @@ -24,7 +24,8 @@ namespace WebKit { class WebFrame; } -namespace webkit_glue { +namespace webkit { +namespace npapi { class WebPluginDelegate; class WebPluginParentView; @@ -195,6 +196,7 @@ class WebPluginResourceClient { virtual int ResourceId() = 0; }; -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit -#endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_H_ +#endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_H_ diff --git a/webkit/glue/plugins/webplugin_2d_device_delegate.cc b/webkit/plugins/npapi/webplugin_2d_device_delegate.cc index f971e20..d5a709e 100644 --- a/webkit/glue/plugins/webplugin_2d_device_delegate.cc +++ b/webkit/plugins/npapi/webplugin_2d_device_delegate.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/webplugin_2d_device_delegate.h" +#include "webkit/plugins/npapi/webplugin_2d_device_delegate.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { NPError WebPlugin2DDeviceDelegate::Device2DQueryCapability(int32 capability, int32* value) { @@ -50,4 +51,5 @@ NPError WebPlugin2DDeviceDelegate::Device2DDestroyContext( return NPERR_GENERIC_ERROR; } -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin_2d_device_delegate.h b/webkit/plugins/npapi/webplugin_2d_device_delegate.h index e18c2fd..094ddc5 100644 --- a/webkit/glue/plugins/webplugin_2d_device_delegate.h +++ b/webkit/plugins/npapi/webplugin_2d_device_delegate.h @@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_WEBPLUGIN_2D_DEVICE_DELEGATE_H_ -#define WEBKIT_GLUE_PLUGINS_WEBPLUGIN_2D_DEVICE_DELEGATE_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_2D_DEVICE_DELEGATE_H_ +#define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_2D_DEVICE_DELEGATE_H_ #include "base/basictypes.h" #include "third_party/npapi/bindings/npapi_extensions.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { // Interface for the NPAPI 2D device extension. This class implements "NOP" // versions of all these functions so it can be used seamlessly by the @@ -38,6 +39,7 @@ class WebPlugin2DDeviceDelegate { virtual ~WebPlugin2DDeviceDelegate() {} }; -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_PLUGINS_WEBPLUGIN_2D_DEVICE_DELEGATE_H_ +#endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_2D_DEVICE_DELEGATE_H_ diff --git a/webkit/glue/plugins/webplugin_3d_device_delegate.cc b/webkit/plugins/npapi/webplugin_3d_device_delegate.cc index 93dffa6..132b6d0 100644 --- a/webkit/glue/plugins/webplugin_3d_device_delegate.cc +++ b/webkit/plugins/npapi/webplugin_3d_device_delegate.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/webplugin_3d_device_delegate.h" +#include "webkit/plugins/npapi/webplugin_3d_device_delegate.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { NPError WebPlugin3DDeviceDelegate::Device3DQueryCapability(int32 capability, int32* value) { @@ -105,6 +106,6 @@ NPError WebPlugin3DDeviceDelegate::Device3DSynchronizeContext( return NPERR_GENERIC_ERROR; } - -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin_3d_device_delegate.h b/webkit/plugins/npapi/webplugin_3d_device_delegate.h index 2f64b45..45c94aa 100644 --- a/webkit/glue/plugins/webplugin_3d_device_delegate.h +++ b/webkit/plugins/npapi/webplugin_3d_device_delegate.h @@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_WEBPLUGIN_3D_DEVICE_DELEGATE_H_ -#define WEBKIT_GLUE_PLUGINS_WEBPLUGIN_3D_DEVICE_DELEGATE_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_3D_DEVICE_DELEGATE_H_ +#define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_3D_DEVICE_DELEGATE_H_ #include "base/basictypes.h" #include "third_party/npapi/bindings/npapi_extensions.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { // Interface for the NPAPI 3D device extension. This class implements "NOP" // versions of all these functions so it can be used seamlessly by the @@ -66,6 +67,7 @@ class WebPlugin3DDeviceDelegate { virtual ~WebPlugin3DDeviceDelegate() {} }; -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_PLUGINS_WEBPLUGIN_3D_DEVICE_DELEGATE_H_ +#endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_3D_DEVICE_DELEGATE_H_ diff --git a/webkit/glue/plugins/webplugin_accelerated_surface_mac.h b/webkit/plugins/npapi/webplugin_accelerated_surface_mac.h index 13980ca..d26d523 100644 --- a/webkit/glue/plugins/webplugin_accelerated_surface_mac.h +++ b/webkit/plugins/npapi/webplugin_accelerated_surface_mac.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_WEBPLUGIN_ACCELERATED_SURFACE_MAC_H_ -#define WEBKIT_GLUE_WEBPLUGIN_ACCELERATED_SURFACE_MAC_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_ACCELERATED_SURFACE_MAC_H_ +#define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_ACCELERATED_SURFACE_MAC_H_ #pragma once #include "gfx/native_widget_types.h" @@ -12,7 +12,8 @@ // Avoid having to include OpenGL headers here. typedef struct _CGLContextObject* CGLContextObj; -namespace webkit_glue { +namespace webkit { +namespace npapi { // Interface class for interacting with an accelerated plugin surface, used // for the Core Animation flavors of plugin drawing on the Mac. @@ -39,6 +40,7 @@ class WebPluginAcceleratedSurface { virtual void EndDrawing() = 0; }; -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_WEBPLUGIN_ACCELERATED_SURFACE_MAC_H_ +#endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_ACCELERATED_SURFACE_MAC_H_ diff --git a/webkit/glue/plugins/webplugin_audio_device_delegate.cc b/webkit/plugins/npapi/webplugin_audio_device_delegate.cc index 8cc3d62..0e463c5 100644 --- a/webkit/glue/plugins/webplugin_audio_device_delegate.cc +++ b/webkit/plugins/npapi/webplugin_audio_device_delegate.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/webplugin_audio_device_delegate.h" +#include "webkit/plugins/npapi/webplugin_audio_device_delegate.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { NPError WebPluginAudioDeviceDelegate::DeviceAudioQueryCapability( int32 capability, int32* value) { @@ -46,5 +47,5 @@ NPError WebPluginAudioDeviceDelegate::DeviceAudioDestroyContext( return NPERR_GENERIC_ERROR; } - -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin_audio_device_delegate.h b/webkit/plugins/npapi/webplugin_audio_device_delegate.h index de85433..c95d206 100644 --- a/webkit/glue/plugins/webplugin_audio_device_delegate.h +++ b/webkit/plugins/npapi/webplugin_audio_device_delegate.h @@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_WEBPLUGIN_AUDIO_DEVICE_DELEGATE_H_ -#define WEBKIT_GLUE_PLUGINS_WEBPLUGIN_AUDIO_DEVICE_DELEGATE_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_AUDIO_DEVICE_DELEGATE_H_ +#define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_AUDIO_DEVICE_DELEGATE_H_ #include "base/basictypes.h" #include "third_party/npapi/bindings/npapi_extensions.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { // Interface for the NPAPI audio device extension. This class implements "NOP" // versions of all these functions so it can be used seamlessly by the @@ -36,7 +37,8 @@ class WebPluginAudioDeviceDelegate { virtual ~WebPluginAudioDeviceDelegate() {} }; -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_PLUGINS_WEBPLUGIN_AUDIO_DEVICE_DELEGATE_H_ +#endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_AUDIO_DEVICE_DELEGATE_H_ diff --git a/webkit/glue/plugins/webplugin_delegate.cc b/webkit/plugins/npapi/webplugin_delegate.cc index c3fb53b..f8ea1cb 100644 --- a/webkit/glue/plugins/webplugin_delegate.cc +++ b/webkit/plugins/npapi/webplugin_delegate.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/webplugin_delegate.h" +#include "webkit/plugins/npapi/webplugin_delegate.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { bool WebPluginDelegate::StartFind(const string16& search_text, bool case_sensitive, @@ -36,5 +37,5 @@ string16 WebPluginDelegate::GetSelectionAsMarkup() const { return string16(); } - -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin_delegate.h b/webkit/plugins/npapi/webplugin_delegate.h index ac7bb5c..ff604ed 100644 --- a/webkit/glue/plugins/webplugin_delegate.h +++ b/webkit/plugins/npapi/webplugin_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H_ -#define WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_H_ +#define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_H_ #include <string> #include <vector> @@ -14,11 +14,11 @@ #include "third_party/npapi/bindings/npapi.h" #include "third_party/npapi/bindings/npapi_extensions.h" #include "third_party/WebKit/WebKit/chromium/public/WebCanvas.h" -#include "webkit/glue/plugins/webplugin_2d_device_delegate.h" -#include "webkit/glue/plugins/webplugin_3d_device_delegate.h" -#include "webkit/glue/plugins/webplugin_audio_device_delegate.h" -#include "webkit/glue/plugins/webplugin_file_delegate.h" -#include "webkit/glue/plugins/webplugin_print_delegate.h" +#include "webkit/plugins/npapi/webplugin_2d_device_delegate.h" +#include "webkit/plugins/npapi/webplugin_3d_device_delegate.h" +#include "webkit/plugins/npapi/webplugin_audio_device_delegate.h" +#include "webkit/plugins/npapi/webplugin_file_delegate.h" +#include "webkit/plugins/npapi/webplugin_print_delegate.h" class FilePath; class GURL; @@ -33,7 +33,8 @@ namespace gfx { class Rect; } -namespace webkit_glue { +namespace webkit { +namespace npapi { class WebPlugin; class WebPluginResourceClient; @@ -161,6 +162,7 @@ class WebPluginDelegate : public WebPlugin2DDeviceDelegate, virtual string16 GetSelectionAsMarkup() const; }; -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H_ +#endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_H_ diff --git a/webkit/glue/plugins/webplugin_delegate_impl.cc b/webkit/plugins/npapi/webplugin_delegate_impl.cc index e3e4f9d..ed80a4d 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.cc +++ b/webkit/plugins/npapi/webplugin_delegate_impl.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/glue/plugins/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" #include <string> #include <vector> @@ -13,27 +13,27 @@ #include "base/scoped_ptr.h" #include "base/string_util.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.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/webkit_glue.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" -using webkit_glue::WebPlugin; -using webkit_glue::WebPluginDelegate; -using webkit_glue::WebPluginResourceClient; using WebKit::WebCursorInfo; using WebKit::WebKeyboardEvent; using WebKit::WebInputEvent; using WebKit::WebMouseEvent; +namespace webkit { +namespace npapi { + WebPluginDelegateImpl* WebPluginDelegateImpl::Create( const FilePath& filename, const std::string& mime_type, gfx::PluginWindowHandle containing_view) { - scoped_refptr<NPAPI::PluginLib> plugin_lib( - NPAPI::PluginLib::CreatePluginLib(filename)); + scoped_refptr<PluginLib> plugin_lib( + PluginLib::CreatePluginLib(filename)); if (plugin_lib.get() == NULL) return NULL; @@ -41,7 +41,7 @@ WebPluginDelegateImpl* WebPluginDelegateImpl::Create( if (err != NPERR_NO_ERROR) return NULL; - scoped_refptr<NPAPI::PluginInstance> instance( + scoped_refptr<PluginInstance> instance( plugin_lib->CreateInstance(mime_type)); return new WebPluginDelegateImpl(containing_view, instance.get()); } @@ -64,7 +64,7 @@ bool WebPluginDelegateImpl::Initialize( instance_->set_web_plugin(plugin_); if (quirks_ & PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES) { - NPAPI::PluginLib* plugin_lib = instance()->plugin_lib(); + PluginLib* plugin_lib = instance()->plugin_lib(); if (plugin_lib->instance_count() > 1) { return false; } @@ -302,3 +302,6 @@ WebPluginResourceClient* WebPluginDelegateImpl::CreateSeekableResourceClient( unsigned long resource_id, int range_request_id) { return instance()->GetRangeRequest(range_request_id); } + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/plugins/npapi/webplugin_delegate_impl.h index 4046c95..6937fe7 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.h +++ b/webkit/plugins/npapi/webplugin_delegate_impl.h @@ -2,10 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_WEBPLUGIN_DELEGATE_IMPL_H_ -#define WEBKIT_GLUE_PLUGINS_WEBPLUGIN_DELEGATE_IMPL_H_ - -#include "build/build_config.h" +#ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ +#define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ #include <string> #include <list> @@ -15,10 +13,11 @@ #include "base/task.h" #include "base/time.h" #include "base/timer.h" +#include "build/build_config.h" #include "gfx/native_widget_types.h" #include "gfx/rect.h" #include "third_party/npapi/bindings/npapi.h" -#include "webkit/glue/plugins/webplugin_delegate.h" +#include "webkit/plugins/npapi/webplugin_delegate.h" #include "webkit/glue/webcursor.h" #if defined(USE_X11) @@ -29,19 +28,11 @@ typedef struct _GdkDrawable GdkPixmap; class FilePath; -namespace NPAPI { -class PluginInstance; -} - namespace WebKit { class WebMouseEvent; } #if defined(OS_MACOSX) -class ExternalDragTracker; -#ifndef NP_NO_QUICKDRAW -class QuickDrawDrawingManager; -#endif #ifdef __OBJC__ @class CALayer; @class CARenderer; @@ -49,14 +40,24 @@ class QuickDrawDrawingManager; class CALayer; class CARenderer; #endif -namespace webkit_glue { -class WebPluginAcceleratedSurface; -} #endif +namespace webkit { +namespace npapi { + +class PluginInstance; + +#if defined(OS_MACOSX) +class WebPluginAcceleratedSurface; +class ExternalDragTracker; +#ifndef NP_NO_QUICKDRAW +class QuickDrawDrawingManager; +#endif // NP_NO_QUICKDRAW +#endif // OS_MACOSX + // An implementation of WebPluginDelegate that runs in the plugin process, // proxied from the renderer by WebPluginDelegateProxy. -class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { +class WebPluginDelegateImpl : public WebPluginDelegate { public: enum PluginQuirks { PLUGIN_QUIRK_SETWINDOW_TWICE = 1, // Win32 @@ -94,7 +95,7 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { virtual bool Initialize(const GURL& url, const std::vector<std::string>& arg_names, const std::vector<std::string>& arg_values, - webkit_glue::WebPlugin* plugin, + WebPlugin* plugin, bool load_manually); virtual void PluginDestroyed(); virtual void UpdateGeometry(const gfx::Rect& window_rect, @@ -121,9 +122,9 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { virtual void DidFinishManualLoading(); virtual void DidManualLoadFail(); virtual void InstallMissingPlugin(); - virtual webkit_glue::WebPluginResourceClient* CreateResourceClient( + virtual WebPluginResourceClient* CreateResourceClient( unsigned long resource_id, const GURL& url, int notify_id); - virtual webkit_glue::WebPluginResourceClient* CreateSeekableResourceClient( + virtual WebPluginResourceClient* CreateSeekableResourceClient( unsigned long resource_id, int range_request_id); // End of WebPluginDelegate implementation. @@ -194,10 +195,10 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { private: friend class DeleteTask<WebPluginDelegateImpl>; - friend class webkit_glue::WebPluginDelegate; + friend class WebPluginDelegate; WebPluginDelegateImpl(gfx::PluginWindowHandle containing_view, - NPAPI::PluginInstance *instance); + PluginInstance *instance); ~WebPluginDelegateImpl(); // Called by Initialize() for platform-specific initialization. @@ -273,7 +274,7 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { bool PlatformHandleInputEvent(const WebKit::WebInputEvent& event, WebKit::WebCursorInfo* cursor_info); - NPAPI::PluginInstance* instance() { return instance_.get(); } + PluginInstance* instance() { return instance_.get(); } // Closes down and destroys our plugin instance. void DestroyInstance(); @@ -292,8 +293,8 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { // used by windowed and windowless plugins bool windowless_; - webkit_glue::WebPlugin* plugin_; - scoped_refptr<NPAPI::PluginInstance> instance_; + WebPlugin* plugin_; + scoped_refptr<PluginInstance> instance_; #if defined(OS_WIN) // Original wndproc before we subclassed. @@ -429,7 +430,7 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { #endif CALayer* layer_; // Used for CA drawing mode. Weak, retained by plug-in. - webkit_glue::WebPluginAcceleratedSurface* surface_; // Weak ref. + WebPluginAcceleratedSurface* surface_; // Weak ref. CARenderer* renderer_; // Renders layer_ to surface_. scoped_ptr<base::RepeatingTimer<WebPluginDelegateImpl> > redraw_timer_; @@ -508,4 +509,7 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); }; -#endif // WEBKIT_GLUE_PLUGINS_WEBPLUGIN_DELEGATE_IMPL_H_ +} // namespace npapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ diff --git a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc b/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc index 609b41e..ab69e69 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc +++ b/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" #include <string> #include <vector> @@ -20,14 +20,14 @@ #include "skia/ext/platform_canvas.h" #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" -#include "webkit/glue/plugins/gtk_plugin_container.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/gtk_plugin_container.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" #include "third_party/npapi/bindings/npapi_x11.h" @@ -36,9 +36,12 @@ using WebKit::WebKeyboardEvent; using WebKit::WebInputEvent; using WebKit::WebMouseEvent; +namespace webkit { +namespace npapi { + WebPluginDelegateImpl::WebPluginDelegateImpl( gfx::PluginWindowHandle containing_view, - NPAPI::PluginInstance *instance) + PluginInstance *instance) : windowed_handle_(0), windowed_did_set_window_(false), windowless_(false), @@ -765,3 +768,6 @@ bool WebPluginDelegateImpl::PlatformHandleInputEvent( return ret; } + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm index 552484a..cf5df05 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm +++ b/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm @@ -5,7 +5,7 @@ #import <Cocoa/Cocoa.h> #import <QuartzCore/QuartzCore.h> -#include "webkit/glue/plugins/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" #include <string> #include <unistd.h> @@ -19,55 +19,56 @@ #include "base/utf_string_conversions.h" #include "base/sys_string_conversions.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.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/plugin_web_event_converter_mac.h" -#include "webkit/glue/plugins/webplugin.h" -#include "webkit/glue/plugins/webplugin_accelerated_surface_mac.h" #include "webkit/glue/webkit_glue.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/plugin_web_event_converter_mac.h" +#include "webkit/plugins/npapi/webplugin.h" +#include "webkit/plugins/npapi/webplugin_accelerated_surface_mac.h" #ifndef NP_NO_CARBON -#include "webkit/glue/plugins/carbon_plugin_window_tracker_mac.h" +#include "webkit/plugins/npapi/carbon_plugin_window_tracker_mac.h" #endif #ifndef NP_NO_QUICKDRAW -#include "webkit/glue/plugins/quickdraw_drawing_manager_mac.h" +#include "webkit/plugins/npapi/quickdraw_drawing_manager_mac.h" #endif -using webkit_glue::WebPlugin; -using webkit_glue::WebPluginDelegate; -using webkit_glue::WebPluginResourceClient; using WebKit::WebCursorInfo; using WebKit::WebKeyboardEvent; using WebKit::WebInputEvent; using WebKit::WebMouseEvent; using WebKit::WebMouseWheelEvent; -const int kCoreAnimationRedrawPeriodMs = 10; // 100 Hz - // Important implementation notes: The Mac definition of NPAPI, particularly // the distinction between windowed and windowless modes, differs from the // Windows and Linux definitions. Most of those differences are // accomodated by the WebPluginDelegate class. +namespace webkit { +namespace npapi { + namespace { +const int kCoreAnimationRedrawPeriodMs = 10; // 100 Hz + WebPluginDelegateImpl* g_active_delegate; // Helper to simplify correct usage of g_active_delegate. Instantiating will // set the active delegate to |delegate| for the lifetime of the object, then // NULL when it goes out of scope. class ScopedActiveDelegate { -public: + public: explicit ScopedActiveDelegate(WebPluginDelegateImpl* delegate) { g_active_delegate = delegate; } ~ScopedActiveDelegate() { g_active_delegate = NULL; } -private: + + private: DISALLOW_COPY_AND_ASSIGN(ScopedActiveDelegate); }; @@ -248,7 +249,7 @@ int ExternalDragTracker::WebEventButtonModifierMask() { WebPluginDelegateImpl::WebPluginDelegateImpl( gfx::PluginWindowHandle containing_view, - NPAPI::PluginInstance *instance) + PluginInstance *instance) : windowed_handle_(NULL), // all Mac plugins are "windowless" in the Windows/X11 sense windowless_(true), @@ -568,7 +569,7 @@ bool WebPluginDelegateImpl::PlatformHandleInputEvent( // When an external drag ends, we need to synthesize a MouseEntered. NPCocoaEvent enter_event = *(static_cast<NPCocoaEvent*>(plugin_event)); enter_event.type = NPCocoaEventMouseEntered; - NPAPI::ScopedCurrentPluginEvent event_scope(instance(), &enter_event); + ScopedCurrentPluginEvent event_scope(instance(), &enter_event); instance()->NPP_HandleEvent(&enter_event); } return false; @@ -576,9 +577,9 @@ bool WebPluginDelegateImpl::PlatformHandleInputEvent( } // Send the plugin the event. - scoped_ptr<NPAPI::ScopedCurrentPluginEvent> event_scope(NULL); + scoped_ptr<ScopedCurrentPluginEvent> event_scope(NULL); if (instance()->event_model() == NPEventModelCocoa) { - event_scope.reset(new NPAPI::ScopedCurrentPluginEvent( + event_scope.reset(new ScopedCurrentPluginEvent( instance(), static_cast<NPCocoaEvent*>(plugin_event))); } int16_t handle_response = instance()->NPP_HandleEvent(plugin_event); @@ -1143,3 +1144,6 @@ void WebPluginDelegateImpl::SetQuickDrawFastPathEnabled(bool enabled) { WindowlessPaint(buffer_context_, clip_rect_); } #endif // !NP_NO_QUICKDRAW + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin_delegate_impl_win.cc b/webkit/plugins/npapi/webplugin_delegate_impl_win.cc index e1acba1..4739a9c 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_win.cc +++ b/webkit/plugins/npapi/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/glue/plugins/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" #include <map> #include <string> @@ -22,20 +22,23 @@ #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"; @@ -181,12 +184,9 @@ std::wstring GetKeyPath(HKEY key) { } // namespace bool WebPluginDelegateImpl::IsPluginDelegateWindow(HWND window) { - // 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))) + static const int kBufLen = 64; + wchar_t class_name[kBufLen]; + if (!GetClassNameW(window, class_name, kBufLen)) return false; return wcscmp(class_name, kNativeWindowClassName) == 0; } @@ -246,7 +246,7 @@ LRESULT CALLBACK WebPluginDelegateImpl::MouseHookProc( WebPluginDelegateImpl::WebPluginDelegateImpl( gfx::PluginWindowHandle containing_view, - NPAPI::PluginInstance *instance) + 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) { - NPAPI::PluginLib* plugin_lib = instance()->plugin_lib(); + PluginLib* plugin_lib = instance()->plugin_lib(); if (plugin_lib != NULL) { std::wstring plugin_name = plugin_lib->plugin_info().name; if (!plugin_name.empty()) { @@ -1408,3 +1408,6 @@ void WebPluginDelegateImpl::HandleCaptureForMessage(HWND window, break; } } + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin_file_delegate.cc b/webkit/plugins/npapi/webplugin_file_delegate.cc index 68c4c60..e110a6b 100644 --- a/webkit/glue/plugins/webplugin_file_delegate.cc +++ b/webkit/plugins/npapi/webplugin_file_delegate.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/webplugin_file_delegate.h" +#include "webkit/plugins/npapi/webplugin_file_delegate.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { bool WebPluginFileDelegate::ChooseFile(const char* mime_types, int mode, @@ -13,5 +14,6 @@ bool WebPluginFileDelegate::ChooseFile(const char* mime_types, return false; } -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin_file_delegate.h b/webkit/plugins/npapi/webplugin_file_delegate.h index ad2bba0..15822af 100644 --- a/webkit/glue/plugins/webplugin_file_delegate.h +++ b/webkit/plugins/npapi/webplugin_file_delegate.h @@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_WEBPLUGIN_FILE_DELEGATE_H_ -#define WEBKIT_GLUE_PLUGINS_WEBPLUGIN_FILE_DELEGATE_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_FILE_DELEGATE_H_ +#define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_FILE_DELEGATE_H_ #include "base/basictypes.h" #include "third_party/npapi/bindings/npapi_extensions.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { // Interface for the NPAPI file extensions. This class implements "NOP" // versions of all these functions so it can be used seamlessly by the @@ -28,6 +29,7 @@ class WebPluginFileDelegate { virtual ~WebPluginFileDelegate() {} }; -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_PLUGINS_WEBPLUGIN_FILE_DELEGATE_H_ +#endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_FILE_DELEGATE_H_ diff --git a/webkit/glue/plugins/webplugin_impl.cc b/webkit/plugins/npapi/webplugin_impl.cc index 666775b..97c2f28 100644 --- a/webkit/glue/plugins/webplugin_impl.cc +++ b/webkit/plugins/npapi/webplugin_impl.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/glue/plugins/webplugin_impl.h" +#include "webkit/plugins/npapi/webplugin_impl.h" #include "base/linked_ptr.h" #include "base/logging.h" @@ -39,10 +39,10 @@ #include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "webkit/appcache/web_application_cache_host_impl.h" #include "webkit/glue/multipart_response_delegate.h" -#include "webkit/glue/plugins/plugin_host.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/webplugin_delegate.h" -#include "webkit/glue/plugins/webplugin_page_delegate.h" +#include "webkit/plugins/npapi/plugin_host.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/webplugin_delegate.h" +#include "webkit/plugins/npapi/webplugin_page_delegate.h" using appcache::WebApplicationCacheHostImpl; using WebKit::WebCanvas; @@ -73,7 +73,9 @@ using WebKit::WebVector; using WebKit::WebView; using webkit_glue::MultipartResponseDelegate; -namespace webkit_glue { +namespace webkit { +namespace npapi { + namespace { // This class handles individual multipart responses. It is instantiated when @@ -601,7 +603,7 @@ bool WebPluginImpl::SetPostData(WebURLRequest* request, std::vector<std::string> names; std::vector<std::string> values; std::vector<char> body; - bool rv = NPAPI::PluginHost::SetPostData(buf, length, &names, &values, &body); + bool rv = PluginHost::SetPostData(buf, length, &names, &values, &body); for (size_t i = 0; i < names.size(); ++i) { request->addHTTPHeaderField(WebString::fromUTF8(names[i]), @@ -1390,4 +1392,5 @@ WebDevToolsAgent* WebPluginImpl::GetDevToolsAgent() { return view->devToolsAgent(); } -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin_impl.h b/webkit/plugins/npapi/webplugin_impl.h index 27a692b..c1115dc 100644 --- a/webkit/glue/plugins/webplugin_impl.h +++ b/webkit/plugins/npapi/webplugin_impl.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ -#define WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_IMPL_H_ +#define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_IMPL_H_ #include <string> #include <map> @@ -21,7 +21,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h" #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/webplugin.h" class WebViewDelegate; @@ -35,8 +35,12 @@ class WebURLRequest; } namespace webkit_glue { - class MultipartResponseDelegate; +} // namespace webkit_glue + +namespace webkit { +namespace npapi { + class WebPluginDelegate; class WebPluginPageDelegate; @@ -325,6 +329,7 @@ class WebPluginImpl : public WebPlugin, DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); }; -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit -#endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ +#endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_IMPL_H_ diff --git a/webkit/glue/plugins/webplugin_impl_unittest.cc b/webkit/plugins/npapi/webplugin_impl_unittest.cc index e70e39a..45d4ddc 100644 --- a/webkit/glue/plugins/webplugin_impl_unittest.cc +++ b/webkit/plugins/npapi/webplugin_impl_unittest.cc @@ -7,21 +7,18 @@ #include "third_party/WebKit/WebKit/chromium/public/WebCString.h" #include "third_party/WebKit/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" -#include "webkit/glue/plugins/webplugin_impl.h" +#include "webkit/plugins/npapi/webplugin_impl.h" using WebKit::WebHTTPBody; using WebKit::WebString; using WebKit::WebURLRequest; -using webkit_glue::WebPluginImpl; -namespace { - -class WebPluginImplTest : public testing::Test { -}; +namespace webkit { +namespace npapi { -} +namespace { -static std::string GetHeader(const WebURLRequest& request, const char* name) { +std::string GetHeader(const WebURLRequest& request, const char* name) { std::string result; TrimWhitespace( request.httpHeaderField(WebString::fromUTF8(name)).utf8(), @@ -30,7 +27,7 @@ static std::string GetHeader(const WebURLRequest& request, const char* name) { return result; } -static std::string GetBodyText(const WebURLRequest& request) { +std::string GetBodyText(const WebURLRequest& request) { const WebHTTPBody& body = request.httpBody(); if (body.isNull()) return std::string(); @@ -48,6 +45,8 @@ static std::string GetBodyText(const WebURLRequest& request) { return result; } +} // namespace + // The Host functions for NPN_PostURL and NPN_PostURLNotify // need to parse out some HTTP headers. Make sure it works // with the following tests @@ -230,3 +229,6 @@ TEST(WebPluginImplTest, PostParserBodyWithBinaryData) { EXPECT_EQ(0xFF, (unsigned char)body[2]); EXPECT_EQ(0xFF, (unsigned char)body[3]); } + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin_page_delegate.h b/webkit/plugins/npapi/webplugin_page_delegate.h index d915fdd..15aa730 100644 --- a/webkit/glue/plugins/webplugin_page_delegate.h +++ b/webkit/plugins/npapi/webplugin_page_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_WEBPLUGIN_PAGE_DELEGATE_ -#define WEBKIT_GLUE_WEBPLUGIN_PAGE_DELEGATE_ +#ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_PAGE_DELEGATE_ +#define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_PAGE_DELEGATE_ #include "gfx/native_widget_types.h" @@ -14,7 +14,8 @@ namespace WebKit { class WebCookieJar; } -namespace webkit_glue { +namespace webkit { +namespace npapi { class WebPluginDelegate; struct WebPluginGeometry; @@ -23,7 +24,7 @@ struct WebPluginGeometry; class WebPluginPageDelegate { public: // This method is called to create a WebPluginDelegate implementation when a - // new plugin is instanced. See webkit_glue::CreateWebPluginDelegateHelper + // new plugin is instanced. See CreateWebPluginDelegateHelper // for a default WebPluginDelegate implementation. virtual WebPluginDelegate* CreatePluginDelegate( const FilePath& file_path, @@ -64,6 +65,7 @@ class WebPluginPageDelegate { virtual WebKit::WebCookieJar* GetCookieJar() = 0; }; -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_WEBPLUGIN_PAGE_DELEGATE_H_ +#endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_PAGE_DELEGATE_H_ diff --git a/webkit/glue/plugins/webplugin_print_delegate.cc b/webkit/plugins/npapi/webplugin_print_delegate.cc index 07bf9b8..a90170b 100644 --- a/webkit/glue/plugins/webplugin_print_delegate.cc +++ b/webkit/plugins/npapi/webplugin_print_delegate.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/webplugin_print_delegate.h" +#include "webkit/plugins/npapi/webplugin_print_delegate.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { bool WebPluginPrintDelegate::PrintSupportsPrintExtension() { return false; @@ -23,4 +24,5 @@ bool WebPluginPrintDelegate::PrintPage(int page_number, void WebPluginPrintDelegate::PrintEnd() { } -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webplugin_print_delegate.h b/webkit/plugins/npapi/webplugin_print_delegate.h index 24298e8..7c8ccf4 100644 --- a/webkit/glue/plugins/webplugin_print_delegate.h +++ b/webkit/plugins/npapi/webplugin_print_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_WEBPLUGIN_PRINT_DELEGATE_H_ -#define WEBKIT_GLUE_PLUGINS_WEBPLUGIN_PRINT_DELEGATE_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_PRINT_DELEGATE_H_ +#define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_PRINT_DELEGATE_H_ #include "base/basictypes.h" #include "third_party/npapi/bindings/npapi_extensions.h" @@ -13,7 +13,8 @@ namespace gfx { class Rect; } -namespace webkit_glue { +namespace webkit { +namespace npapi { // Interface for the NPAPI print extension. This class implements "NOP" // versions of all these functions so it can be used seamlessly by the @@ -37,7 +38,8 @@ class WebPluginPrintDelegate { virtual ~WebPluginPrintDelegate() {} }; -} // namespace webkit_glue +} // namespace npapi +} // namespace webkit -#endif // WEBKIT_GLUE_PLUGINS_WEBPLUGIN_PRINT_DELEGATE_H_ +#endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_PRINT_DELEGATE_H_ diff --git a/webkit/glue/plugins/webplugininfo.cc b/webkit/plugins/npapi/webplugininfo.cc index 7d2b4e4..c055953 100644 --- a/webkit/glue/plugins/webplugininfo.cc +++ b/webkit/plugins/npapi/webplugininfo.cc @@ -2,7 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/plugins/webplugininfo.h" +#include "webkit/plugins/npapi/webplugininfo.h" + +namespace webkit { +namespace npapi { WebPluginMimeType::WebPluginMimeType() {} @@ -42,3 +45,6 @@ WebPluginInfo::WebPluginInfo(const string16& fake_name, enabled(true) { } +} // namespace npapi +} // namespace webkit + diff --git a/webkit/glue/plugins/webplugininfo.h b/webkit/plugins/npapi/webplugininfo.h index 34eff3d..6b9f240 100644 --- a/webkit/glue/plugins/webplugininfo.h +++ b/webkit/plugins/npapi/webplugininfo.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_WEBPLUGININFO_H_ -#define WEBKIT_GLUE_WEBPLUGININFO_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGININFO_H_ +#define WEBKIT_PLUGINS_NPAPI_WEBPLUGININFO_H_ #include <string> #include <vector> @@ -11,6 +11,9 @@ #include "base/basictypes.h" #include "base/file_path.h" +namespace webkit { +namespace npapi { + // Describes a mime type entry for a plugin. struct WebPluginMimeType { WebPluginMimeType(); @@ -57,4 +60,7 @@ struct WebPluginInfo { bool enabled; }; -#endif // WEBKIT_GLUE_WEBPLUGININFO_H_ +} // namespace npapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGININFO_H_ diff --git a/webkit/glue/plugins/webview_plugin.cc b/webkit/plugins/npapi/webview_plugin.cc index f89ccb4..6788fc5 100644 --- a/webkit/glue/plugins/webview_plugin.cc +++ b/webkit/plugins/npapi/webview_plugin.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/glue/plugins/webview_plugin.h" +#include "webkit/plugins/npapi/webview_plugin.h" #include "base/message_loop.h" #include "base/metrics/histogram.h" @@ -43,6 +43,9 @@ using WebKit::WebURLResponse; using WebKit::WebVector; using WebKit::WebView; +namespace webkit { +namespace npapi { + WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate) : delegate_(delegate), container_(NULL), @@ -233,3 +236,6 @@ WebURLError WebViewPlugin::cancelledError(WebFrame* frame, error.unreachableURL = request.url(); return error; } + +} // namespace npapi +} // namespace webkit diff --git a/webkit/glue/plugins/webview_plugin.h b/webkit/plugins/npapi/webview_plugin.h index f3c75c1..5e2fd20 100644 --- a/webkit/glue/plugins/webview_plugin.h +++ b/webkit/plugins/npapi/webview_plugin.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGINS_WEBVIEW_PLUGIN_H_ -#define WEBKIT_GLUE_PLUGINS_WEBVIEW_PLUGIN_H_ +#ifndef WEBKIT_PLUGINS_NPAPI_WEBVIEW_PLUGIN_H_ +#define WEBKIT_PLUGINS_NPAPI_WEBVIEW_PLUGIN_H_ #include <list> @@ -22,6 +22,9 @@ class WebMouseEvent; } struct WebPreferences; +namespace webkit { +namespace npapi { + // This class implements the WebPlugin interface by forwarding drawing and // handling input events to a WebView. // It can be used as a placeholder for an actual plugin, using HTML for the UI. @@ -79,8 +82,8 @@ class WebViewPlugin: public WebKit::WebPlugin, public WebKit::WebViewClient, const WebKit::WebRect& frame_rect, const WebKit::WebRect& clip_rect, const WebKit::WebVector<WebKit::WebRect>& cut_out_rects, bool is_visible); - virtual void updateFocus(bool) { } - virtual void updateVisibility(bool) { } + virtual void updateFocus(bool) {} + virtual void updateVisibility(bool) {} virtual bool acceptsInputEvents(); virtual bool handleInputEvent(const WebKit::WebInputEvent& event, @@ -93,10 +96,10 @@ class WebViewPlugin: public WebKit::WebPlugin, public WebKit::WebViewClient, // Called in response to WebPluginContainer::loadFrameRequest virtual void didFinishLoadingFrameRequest( - const WebKit::WebURL& url, void* notifyData) { } + const WebKit::WebURL& url, void* notifyData) {} virtual void didFailLoadingFrameRequest(const WebKit::WebURL& url, void* notify_data, - const WebKit::WebURLError& error) { } + const WebKit::WebURLError& error) {} // WebViewClient methods: virtual bool acceptsLoadDrops(); @@ -139,4 +142,7 @@ class WebViewPlugin: public WebKit::WebPlugin, public WebKit::WebViewClient, WebKit::WebString old_title_; }; -#endif // WEBKIT_GLUE_PLUGINS_WEBVIEW_PLUGIN_H_ +} // namespace npapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_NPAPI_WEBVIEW_PLUGIN_H_ diff --git a/webkit/plugins/plugin_switches.cc b/webkit/plugins/plugin_switches.cc index be3342c..e37d416 100644 --- a/webkit/plugins/plugin_switches.cc +++ b/webkit/plugins/plugin_switches.cc @@ -12,4 +12,10 @@ const char kEnablePepperTesting[] = "enable-pepper-testing"; // Dumps extra logging about plugin loading to the log file. const char kDebugPluginLoading[] = "debug-plugin-loading"; +#if defined(OS_WIN) +// Used by the plugins_test when testing the older WMP plugin to force the new +// plugin to not get loaded. +extern const char kUseOldWMPPlugin[] = "use-old-wmp"; +#endif + } // namespace switches diff --git a/webkit/plugins/plugin_switches.h b/webkit/plugins/plugin_switches.h index 7497ec1..8f5aa3c 100644 --- a/webkit/plugins/plugin_switches.h +++ b/webkit/plugins/plugin_switches.h @@ -5,11 +5,17 @@ #ifndef WEBKIT_PLUGINS_PLUGIN_SWITCHES_H_ #define WEBKIT_PLUGINS_PLUGIN_SWITCHES_H_ +#include "build/build_config.h" + namespace switches { extern const char kDebugPluginLoading[]; extern const char kEnablePepperTesting[]; +#if defined(OS_WIN) +extern const char kUseOldWMPPlugin[]; +#endif + } // namespace switches #endif // WEBKIT_PLUGINS_PLUGIN_SWITCHES_H_ diff --git a/webkit/glue/plugins/url_request_info_unittest.cc b/webkit/plugins/ppapi/url_request_info_unittest.cc index 341eeb2..341eeb2 100644 --- a/webkit/glue/plugins/url_request_info_unittest.cc +++ b/webkit/plugins/ppapi/url_request_info_unittest.cc diff --git a/webkit/support/platform_support_mac.mm b/webkit/support/platform_support_mac.mm index 7aeb80b..8ff15a7 100644 --- a/webkit/support/platform_support_mac.mm +++ b/webkit/support/platform_support_mac.mm @@ -17,7 +17,7 @@ #include "base/string16.h" #include "grit/webkit_resources.h" #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" #import "webkit/support/drt_application_mac.h" #import "webkit/tools/test_shell/mac/DumpRenderTreePasteboard.h" @@ -148,7 +148,7 @@ void AfterInitialize(bool unit_test_mode) { FilePath plugins_dir; PathService::Get(base::DIR_EXE, &plugins_dir); plugins_dir = plugins_dir.AppendASCII("../../../plugins"); - NPAPI::PluginList::Singleton()->AddExtraPluginDir(plugins_dir); + webkit::npapi::PluginList::Singleton()->AddExtraPluginDir(plugins_dir); } void BeforeShutdown() { diff --git a/webkit/support/test_webplugin_page_delegate.h b/webkit/support/test_webplugin_page_delegate.h index 95f2b4a..1b4df88 100644 --- a/webkit/support/test_webplugin_page_delegate.h +++ b/webkit/support/test_webplugin_page_delegate.h @@ -7,26 +7,27 @@ #include <string> -#include "webkit/glue/plugins/webplugin_delegate_impl.h" -#include "webkit/glue/plugins/webplugin_page_delegate.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/webplugin_page_delegate.h" namespace webkit_support { -class TestWebPluginPageDelegate : public webkit_glue::WebPluginPageDelegate { +class TestWebPluginPageDelegate : public webkit::npapi::WebPluginPageDelegate { public: TestWebPluginPageDelegate() {} virtual ~TestWebPluginPageDelegate() {} - virtual webkit_glue::WebPluginDelegate* CreatePluginDelegate( + virtual webkit::npapi::WebPluginDelegate* CreatePluginDelegate( const FilePath& file_path, const std::string& mime_type) { // We don't need a valid native window handle in layout tests. // So just passing 0. - return WebPluginDelegateImpl::Create(file_path, mime_type, 0); + return webkit::npapi::WebPluginDelegateImpl::Create( + file_path, mime_type, 0); } virtual void CreatedPluginWindow(gfx::PluginWindowHandle handle) {} virtual void WillDestroyPluginWindow(gfx::PluginWindowHandle handle) {} - virtual void DidMovePlugin(const webkit_glue::WebPluginGeometry& move) {} + virtual void DidMovePlugin(const webkit::npapi::WebPluginGeometry& move) {} virtual void DidStartLoadingForPlugin() {} virtual void DidStopLoadingForPlugin() {} virtual void ShowModalHTMLDialogForPlugin( @@ -40,4 +41,5 @@ class TestWebPluginPageDelegate : public webkit_glue::WebPluginPageDelegate { }; } // namespace webkit_support + #endif // WEBKIT_SUPPORT_TEST_WEBPLUGIN_PAGE_DELEGATE_H_ diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc index 26ae930..d088d3c 100644 --- a/webkit/support/webkit_support.cc +++ b/webkit/support/webkit_support.cc @@ -35,13 +35,13 @@ #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" #include "webkit/appcache/web_application_cache_host_impl.h" #include "webkit/glue/media/video_renderer_impl.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugin_impl.h" -#include "webkit/glue/plugins/webplugin_page_delegate.h" -#include "webkit/glue/plugins/webplugininfo.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webkitclient_impl.h" #include "webkit/glue/webmediaplayer_impl.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugin_impl.h" +#include "webkit/plugins/npapi/webplugin_page_delegate.h" +#include "webkit/plugins/npapi/webplugininfo.h" #include "webkit/support/platform_support.h" #include "webkit/support/test_webplugin_page_delegate.h" #include "webkit/support/test_webkit_client.h" @@ -145,14 +145,14 @@ class TestEnvironment { class WebPluginImplWithPageDelegate : public webkit_support::TestWebPluginPageDelegate, public base::SupportsWeakPtr<WebPluginImplWithPageDelegate>, - public webkit_glue::WebPluginImpl { + public webkit::npapi::WebPluginImpl { public: WebPluginImplWithPageDelegate(WebFrame* frame, const WebPluginParams& params, const FilePath& path, const std::string& mime_type) : webkit_support::TestWebPluginPageDelegate(), - webkit_glue::WebPluginImpl( + webkit::npapi::WebPluginImpl( frame, params, path, mime_type, AsWeakPtr()) {} virtual ~WebPluginImplWithPageDelegate() {} private: @@ -250,9 +250,9 @@ WebKit::WebKitClient* GetWebKitClient() { WebPlugin* CreateWebPlugin(WebFrame* frame, const WebPluginParams& params) { const bool kAllowWildcard = true; - WebPluginInfo info; + webkit::npapi::WebPluginInfo info; std::string actual_mime_type; - if (!NPAPI::PluginList::Singleton()->GetPluginInfo( + if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo( params.url, params.mimeType.utf8(), kAllowWildcard, &info, &actual_mime_type) || !info.enabled) { return NULL; diff --git a/webkit/support/webkit_support_glue.cc b/webkit/support/webkit_support_glue.cc index 2308a40..85d09db 100644 --- a/webkit/support/webkit_support_glue.cc +++ b/webkit/support/webkit_support_glue.cc @@ -7,14 +7,15 @@ #include "base/base_paths.h" #include "base/path_service.h" #include "googleurl/src/gurl.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" // Functions needed by webkit_glue. namespace webkit_glue { -void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { - NPAPI::PluginList::Singleton()->GetPlugins(refresh, plugins); +void GetPlugins(bool refresh, + std::vector<webkit::npapi::WebPluginInfo>* plugins) { + webkit::npapi::PluginList::Singleton()->GetPlugins(refresh, plugins); // Don't load the forked npapi_layout_test_plugin in DRT, we only want to // use the upstream version TestNetscapePlugIn (on Mac, the upstream version // is named WebKitTestNetscapePlugIn). @@ -24,10 +25,10 @@ void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"), }; for (int i = plugins->size() - 1; i >= 0; --i) { - WebPluginInfo plugin_info = plugins->at(i); + webkit::npapi::WebPluginInfo plugin_info = plugins->at(i); for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) { if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) { - NPAPI::PluginList::Singleton()->DisablePlugin(plugin_info.path); + webkit::npapi::PluginList::Singleton()->DisablePlugin(plugin_info.path); plugins->erase(plugins->begin() + i); } } diff --git a/webkit/tools/npapi_pepper_test_plugin/DEPS b/webkit/tools/npapi_pepper_test_plugin/DEPS deleted file mode 100644 index f31c40db..0000000 --- a/webkit/tools/npapi_pepper_test_plugin/DEPS +++ /dev/null @@ -1,4 +0,0 @@ -include_rules = [ - "+gpu/pgl", - "+third_party/gles2_book", -] diff --git a/webkit/tools/npapi_pepper_test_plugin/Info.plist b/webkit/tools/npapi_pepper_test_plugin/Info.plist deleted file mode 100644 index 3d06b29..0000000 --- a/webkit/tools/npapi_pepper_test_plugin/Info.plist +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>${EXECUTABLE_NAME}</string> - <key>CFBundleGetInfoString</key> - <string>Copyright 2010 Google, Inc.</string> - <key>CFBundleIdentifier</key> - <string>com.google.testpepperplugin</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>${PRODUCT_NAME}</string> - <key>CFBundlePackageType</key> - <string>BRPL</string> - <key>CFBundleShortVersionString</key> - <string>1.0</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1.0</string> - <key>CFPlugInDynamicRegisterFunction</key> - <string></string> - <key>CFPlugInDynamicRegistration</key> - <string>NO</string> - <key>WebPluginDescription</key> - <string>Simple NPAPI Pepper plug-in that handles tests</string> - <key>WebPluginMIMETypes</key> - <dict> - <key>pepper-application/x-pepper-test</key> - <dict> - <key>WebPluginExtensions</key> - <array> - <string>testpepper</string> - </array> - <key>WebPluginTypeDescription</key> - <string>Test Pepper API</string> - </dict> - </dict> - <key>WebPluginName</key> - <string>NPAPI Pepper Test PlugIn</string> -</dict> -</plist> diff --git a/webkit/tools/npapi_pepper_test_plugin/main.cc b/webkit/tools/npapi_pepper_test_plugin/main.cc deleted file mode 100644 index 78faa99..0000000 --- a/webkit/tools/npapi_pepper_test_plugin/main.cc +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#if defined(__GNUC__) && __GNUC__ >= 4 -#define EXPORT __attribute__((visibility ("default"))) -#else -#define EXPORT -#endif - -#include "webkit/glue/plugins/test/plugin_client.h" - -extern "C" { -EXPORT NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* nppFuncs) { - return NPAPIClient::PluginClient::GetEntryPoints(nppFuncs); -} - -EXPORT NPError API_CALL NP_Shutdown() { - return NPAPIClient::PluginClient::Shutdown(); -} - -#if defined(OS_POSIX) && !defined(OS_MACOSX) -EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* npnFuncs, - NPPluginFuncs* nppFuncs) { - NPError error = NPAPIClient::PluginClient::Initialize(npnFuncs); - if (error == NPERR_NO_ERROR) { - error = NP_GetEntryPoints(nppFuncs); - } - return error; -} - -EXPORT NPError API_CALL NP_GetValue(NPP instance, NPPVariable variable, - void* value) { - NPError err = NPERR_NO_ERROR; - - switch (variable) { - case NPPVpluginNameString: - *(static_cast<const char**>(value)) = "NPAPI Pepper Test Plugin"; - break; - case NPPVpluginDescriptionString: - *(static_cast<const char**>(value)) = "NPAPI Pepper Test Plugin"; - break; - case NPPVpluginNeedsXEmbed: - *(static_cast<NPBool*>(value)) = true; - break; - default: - err = NPERR_GENERIC_ERROR; - break; - } - - return err; -} - -EXPORT const char* API_CALL NP_GetMIMEDescription() { - return "pepper-application/x-pepper-test:pepper:NPAPI Pepper Test Plugin"; -} -#else // OS_POSIX -EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* npnFuncs) { - return NPAPIClient::PluginClient::Initialize(npnFuncs); -} -#endif // OS_POSIX - -} // extern "C" - diff --git a/webkit/tools/npapi_pepper_test_plugin/pepper_3d_test.cc b/webkit/tools/npapi_pepper_test_plugin/pepper_3d_test.cc deleted file mode 100644 index a440dc6..0000000 --- a/webkit/tools/npapi_pepper_test_plugin/pepper_3d_test.cc +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/tools/npapi_pepper_test_plugin/pepper_3d_test.h" - -namespace { -const int32 kCommandBufferSize = 1024 * 1024; -} // namespace - -namespace NPAPIClient { - -Pepper3DTest::Pepper3DTest(NPP id, NPNetscapeFuncs *host_functions) - : PluginTest(id, host_functions), - pepper_extensions_(NULL), - device_3d_(NULL), -#if defined(ENABLE_NEW_NPDEVICE_API) - context_3d_(NULL), -#endif - pgl_context_(PGL_NO_CONTEXT) { -#if !defined(ENABLE_NEW_NPDEVICE_API) - memset(&context_3d_, 0, sizeof(context_3d_)); -#endif - - esInitContext(&es_context_); - memset(&es_data_, 0, sizeof(es_data_)); - es_context_.userData = &es_data_; -} - -Pepper3DTest::~Pepper3DTest() { -} - -NPError Pepper3DTest::New(uint16 mode, int16 argc, const char* argn[], - const char* argv[], NPSavedData* saved) { - return PluginTest::New(mode, argc, argn, argv, saved); -} - -NPError Pepper3DTest::Destroy() { - DestroyContext(); - pglTerminate(); - return NPERR_NO_ERROR; -} - -NPError Pepper3DTest::SetWindow(NPWindow* window) { - // Create context if needed. - CreateContext(); - - es_context_.width = window->width; - es_context_.height = window->height; - - return NPERR_NO_ERROR; -} - -void Pepper3DTest::RepaintCallback(NPP npp, NPDeviceContext3D* /* context */) { - Pepper3DTest* plugin = static_cast<Pepper3DTest*>(npp->pdata); - plugin->Paint(); -} - -void Pepper3DTest::CreateContext() { - if (pgl_context_ != PGL_NO_CONTEXT) - return; - - HostFunctions()->getvalue(id(), NPNVPepperExtensions, &pepper_extensions_); - if (pepper_extensions_ == NULL) { - SetError("Could not acquire pepper extensions"); - SignalTestCompleted(); - return; - } - - device_3d_ = pepper_extensions_->acquireDevice(id(), NPPepper3DDevice); - if (device_3d_ == NULL) { - SetError("Could not acquire 3D device"); - SignalTestCompleted(); - return; - } - - // Initialize a 3D context. -#if defined(ENABLE_NEW_NPDEVICE_API) - int32 attrib_list[] = { - NP3DAttrib_CommandBufferSize, kCommandBufferSize, - NPAttrib_End - }; - if (device_3d_->createContext(id(), 0, attrib_list, - reinterpret_cast<NPDeviceContext**>(&context_3d_)) != NPERR_NO_ERROR) { - SetError("Could not initialize 3D context"); - SignalTestCompleted(); - return; - } - - device_3d_->registerCallback( - id(), - context_3d_, - NP3DCallback_Repaint, - reinterpret_cast<NPDeviceGenericCallbackPtr>(RepaintCallback), - NULL); -#else - NPDeviceContext3DConfig config; - config.commandBufferSize = kCommandBufferSize; - if (device_3d_->initializeContext(id(), &config, &context_3d_) - != NPERR_NO_ERROR) { - SetError("Could not initialize 3D context"); - SignalTestCompleted(); - return; - } - context_3d_.repaintCallback = RepaintCallback; -#endif // ENABLE_NEW_NPDEVICE_API - - // Initialize PGL and create a PGL context. - if (!pglInitialize()) { - SetError("Could not initialize PGL"); - SignalTestCompleted(); - return; - } -#if defined(ENABLE_NEW_NPDEVICE_API) - pgl_context_ = pglCreateContext(id(), device_3d_, context_3d_); -#else - pgl_context_ = pglCreateContext(id(), device_3d_, &context_3d_); -#endif - if (pgl_context_ == PGL_NO_CONTEXT) { - SetError("Could not initialize PGL context"); - SignalTestCompleted(); - return; - } - - // Initialize OpenGL. - MakeContextCurrent(); - InitGL(); - pglMakeCurrent(PGL_NO_CONTEXT); -} - -void Pepper3DTest::DestroyContext() { - if (pgl_context_ == PGL_NO_CONTEXT) - return; - - MakeContextCurrent(); - ReleaseGL(); - if (!pglDestroyContext(pgl_context_)) { - SetError("Could not destroy PGL context"); - } - pgl_context_ = PGL_NO_CONTEXT; - -#if defined(ENABLE_NEW_NPDEVICE_API) - if (device_3d_->destroyContext(id(), context_3d_) != NPERR_NO_ERROR) { - SetError("Could not destroy 3D context"); - } -#else - if (device_3d_->destroyContext(id(), &context_3d_) != NPERR_NO_ERROR) { - SetError("Could not destroy 3D context"); - } -#endif -} - -void Pepper3DTest::MakeContextCurrent() { - DCHECK(pgl_context_ != PGL_NO_CONTEXT); - - if (!pglMakeCurrent(pgl_context_)) { - SetError("Could not make PGL context current"); - } -} - -void Pepper3DTest::Paint() { - MakeContextCurrent(); - DrawGL(); - TestGL(); - SwapBuffers(); - pglMakeCurrent(PGL_NO_CONTEXT); - - // Painting once is enough to check correctness. - SignalTestCompleted(); -} - -void Pepper3DTest::SwapBuffers() { - if (!pglSwapBuffers()) { - SetError("Could not swap buffers"); - } -} - -void Pepper3DTest::InitGL() { - if (!stInit(&es_context_)) { - SetError("Could not initialize OpenGL resources"); - } -} - -void Pepper3DTest::ReleaseGL() { - stShutDown(&es_context_); -} - -void Pepper3DTest::DrawGL() { - stDraw(&es_context_); -} - -void Pepper3DTest::TestGL() { - // NW quadrant is red. - GLint x = es_context_.width / 4; - GLint y = (3 * es_context_.height) / 4; - GLubyte red_color[3] = {255, 0, 0}; - TestPixel(x, y, red_color); - - // NE quadrant is green. - x = (3 * es_context_.width) / 4; - y = (3 * es_context_.height) / 4; - GLubyte green_color[3] = {0, 255, 0}; - TestPixel(x, y, green_color); - - // SW quadrant is blue. - x = es_context_.width / 4; - y = es_context_.height / 4; - GLubyte blue_color[3] = {0, 0, 255}; - TestPixel(x, y, blue_color); - - // SE quadrant is yellow. - x = (3 * es_context_.width) / 4; - y = es_context_.height / 4; - GLubyte yellow_color[3] = {255, 255, 0}; - TestPixel(x, y, yellow_color); - - // Mid-point is black. - x = es_context_.width / 2; - y = es_context_.height / 2; - GLubyte black_color[3] = {0, 0, 0}; - TestPixel(x, y, black_color); -} - -void Pepper3DTest::TestPixel(int x, int y, const GLubyte expected_color[3]) { - GLubyte pixel_color[4]; - glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel_color); - - ExpectIntegerEqual(pixel_color[0], expected_color[0]); - ExpectIntegerEqual(pixel_color[1], expected_color[1]); - ExpectIntegerEqual(pixel_color[2], expected_color[2]); -} - -} // namespace NPAPIClient diff --git a/webkit/tools/npapi_pepper_test_plugin/pepper_3d_test.h b/webkit/tools/npapi_pepper_test_plugin/pepper_3d_test.h deleted file mode 100644 index 7b3e2db..0000000 --- a/webkit/tools/npapi_pepper_test_plugin/pepper_3d_test.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_TOOLS_NPAPI_PEPPER_TEST_PLUGIN_PEPPER_3D_TEST_H -#define WEBKIT_TOOLS_NPAPI_PEPPER_TEST_PLUGIN_PEPPER_3D_TEST_H - -#include "gpu/pgl/pgl.h" -#include "third_party/gles2_book/Chapter_11/Stencil_Test/Stencil_Test.h" -#include "webkit/glue/plugins/test/plugin_test.h" - -namespace NPAPIClient { - -// This class contains a list of windowed plugin tests. Please add additional -// tests to this class. -class Pepper3DTest : public PluginTest { - public: - Pepper3DTest(NPP id, NPNetscapeFuncs *host_functions); - ~Pepper3DTest(); - - // Pepper tests run in windowless plugin mode. - virtual bool IsWindowless() const { return true; } - - // NPAPI functions. - virtual NPError New(uint16 mode, int16 argc, const char* argn[], - const char* argv[], NPSavedData* saved); - virtual NPError Destroy(); - virtual NPError SetWindow(NPWindow* window); - - private: - static void RepaintCallback(NPP, NPDeviceContext3D*); - - void CreateContext(); - void DestroyContext(); - void MakeContextCurrent(); - void Paint(); - void SwapBuffers(); - - void InitGL(); - void ReleaseGL(); - void DrawGL(); - void TestGL(); - void TestPixel(int x, int y, const GLubyte expected_color[3]); - - NPExtensions* pepper_extensions_; - NPDevice* device_3d_; -#if defined(ENABLE_NEW_NPDEVICE_API) - NPDeviceContext3D* context_3d_; -#else - NPDeviceContext3D context_3d_; -#endif - PGLContext pgl_context_; - - ESContext es_context_; - STUserData es_data_; -}; - -} // namespace NPAPIClient - -#endif // WEBKIT_TOOLS_NPAPI_PEPPER_TEST_PLUGIN_PEPPER_3D_TEST_H diff --git a/webkit/tools/npapi_pepper_test_plugin/plugin.def b/webkit/tools/npapi_pepper_test_plugin/plugin.def deleted file mode 100644 index 2f62dfd..0000000 --- a/webkit/tools/npapi_pepper_test_plugin/plugin.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY npapi_pepper_test_plugin - -EXPORTS - NP_GetEntryPoints @1 - NP_Initialize @2 - NP_Shutdown @3 diff --git a/webkit/tools/npapi_pepper_test_plugin/plugin.rc b/webkit/tools/npapi_pepper_test_plugin/plugin.rc deleted file mode 100644 index 6ee5243..0000000 --- a/webkit/tools/npapi_pepper_test_plugin/plugin.rc +++ /dev/null @@ -1,29 +0,0 @@ -1 VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x17L
- FILEFLAGS 0x0L
- FILEOS 0x4L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "CompanyName", "Google"
- VALUE "FileDescription", "NPAPI Pepper Test Plugin"
- VALUE "FileVersion", "1, 0, 0, 1"
- VALUE "InternalName", "npapi_pepper_test_plugin"
- VALUE "LegalCopyright", "Copyright (C) 2010"
- VALUE "OriginalFilename", "npapi_pepper_test_plugin.dll"
- VALUE "ProductName", "NPAPI Pepper Test Plugin"
- VALUE "ProductVersion", "1, 0, 0, 1"
- VALUE "MIMEType", "pepper-application/x-pepper-test"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
diff --git a/webkit/tools/npapi_pepper_test_plugin/test_factory.cc b/webkit/tools/npapi_pepper_test_plugin/test_factory.cc deleted file mode 100644 index 95055f3..0000000 --- a/webkit/tools/npapi_pepper_test_plugin/test_factory.cc +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/glue/plugins/test/plugin_test_factory.h" - -#include "webkit/tools/npapi_pepper_test_plugin/pepper_3d_test.h" - -namespace NPAPIClient { - -PluginTest* CreatePluginTest(const std::string& test_name, - NPP instance, - NPNetscapeFuncs* host_functions) { - PluginTest* new_test = NULL; - - if (test_name == "pepper_3d") { - new_test = new Pepper3DTest(instance, host_functions); - } - - return new_test; -} - -} // namespace NPAPIClient diff --git a/webkit/tools/test_shell/mac/test_webview_delegate.mm b/webkit/tools/test_shell/mac/test_webview_delegate.mm index b4e553d..bae33f1 100644 --- a/webkit/tools/test_shell/mac/test_webview_delegate.mm +++ b/webkit/tools/test_shell/mac/test_webview_delegate.mm @@ -11,9 +11,9 @@ #include "third_party/WebKit/WebKit/chromium/public/WebPopupMenu.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "webkit/glue/webcursor.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugin_delegate_impl.h" #include "webkit/glue/webmenurunner_mac.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" #include "webkit/tools/test_shell/test_shell.h" using WebKit::WebCursorInfo; @@ -168,7 +168,7 @@ void TestWebViewDelegate::runModal() { // WebPluginPageDelegate ------------------------------------------------------ -webkit_glue::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( +webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( const FilePath& path, const std::string& mime_type) { WebWidgetHost *host = GetWidgetHost(); @@ -176,7 +176,8 @@ webkit_glue::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( return NULL; gfx::PluginWindowHandle containing_view = NULL; - return WebPluginDelegateImpl::Create(path, mime_type, containing_view); + return webkit::npapi::WebPluginDelegateImpl::Create( + path, mime_type, containing_view); } void TestWebViewDelegate::CreatedPluginWindow( @@ -188,7 +189,7 @@ void TestWebViewDelegate::WillDestroyPluginWindow( } void TestWebViewDelegate::DidMovePlugin( - const webkit_glue::WebPluginGeometry& move) { + const webkit::npapi::WebPluginGeometry& move) { // TODO(port): add me once plugins work. } diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 280be89..76f3c81 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -11,9 +11,6 @@ #include "base/debug_on_start.h" #include "base/file_path.h" #include "base/file_util.h" -#if defined(OS_MACOSX) -#include "base/mac_util.h" -#endif #include "base/md5.h" #include "base/message_loop.h" #include "base/metrics/stats_table.h" @@ -34,9 +31,6 @@ #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h" #include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientationClientMock.h" -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) -#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClientMock.h" -#endif #include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputControllerMock.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" @@ -49,10 +43,10 @@ #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "webkit/glue/glue_serialize.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugininfo.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webpreferences.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugininfo.h" #include "webkit/tools/test_shell/accessibility_controller.h" #include "webkit/tools/test_shell/notification_presenter.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" @@ -63,6 +57,14 @@ #include "webkit/tools/test_shell/test_shell_switches.h" #include "webkit/tools/test_shell/test_webview_delegate.h" +#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) +#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClientMock.h" +#endif + +#if defined(OS_MACOSX) +#include "base/mac_util.h" +#endif + using WebKit::WebCanvas; using WebKit::WebFrame; using WebKit::WebNavigationPolicy; @@ -899,8 +901,9 @@ bool GetFontTable(int fd, uint32_t table, uint8_t* output, } #endif -void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { - NPAPI::PluginList::Singleton()->GetPlugins(refresh, plugins); +void GetPlugins(bool refresh, + std::vector<webkit::npapi::WebPluginInfo>* plugins) { + webkit::npapi::PluginList::Singleton()->GetPlugins(refresh, plugins); // Don't load the forked TestNetscapePlugIn in the chromium code, use // the copy in webkit.org's repository instead. const FilePath::StringType kPluginBlackList[] = { @@ -909,10 +912,10 @@ void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"), }; for (int i = plugins->size() - 1; i >= 0; --i) { - WebPluginInfo plugin_info = plugins->at(i); + webkit::npapi::WebPluginInfo plugin_info = plugins->at(i); for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) { if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) { - NPAPI::PluginList::Singleton()->DisablePlugin(plugin_info.path); + webkit::npapi::PluginList::Singleton()->DisablePlugin(plugin_info.path); plugins->erase(plugins->begin() + i); } } diff --git a/webkit/tools/test_shell/test_shell.gypi b/webkit/tools/test_shell/test_shell.gypi index 3fa6fa4..abf1fb0 100644 --- a/webkit/tools/test_shell/test_shell.gypi +++ b/webkit/tools/test_shell/test_shell.gypi @@ -400,10 +400,6 @@ '../../glue/media/simple_data_source_unittest.cc', '../../glue/mimetype_unittest.cc', '../../glue/multipart_response_delegate_unittest.cc', - '../../glue/plugins/plugin_group_unittest.cc', - '../../glue/plugins/plugin_lib_unittest.cc', - '../../glue/plugins/url_request_info_unittest.cc', - '../../glue/plugins/webplugin_impl_unittest.cc', '../../glue/regular_expression_unittest.cc', '../../glue/resource_fetcher_unittest.cc', '../../glue/unittest_test_server.h', @@ -415,6 +411,9 @@ '../../mocks/mock_resource_loader_bridge.h', '../../mocks/mock_webframe.h', '../../mocks/mock_weburlloader.h', + '../../plugins/npapi/plugin_group_unittest.cc', + '../../plugins/npapi/plugin_lib_unittest.cc', + '../../plugins/npapi/webplugin_impl_unittest.cc', '../../plugins/ppapi/callbacks_unittest.cc', '../../plugins/ppapi/mock_plugin_delegate.cc', '../../plugins/ppapi/mock_plugin_delegate.h', @@ -422,6 +421,7 @@ '../../plugins/ppapi/ppapi_unittest.cc', '../../plugins/ppapi/ppapi_unittest.h', '../../plugins/ppapi/resource_tracker_unittest.cc', + '../../plugins/ppapi/url_request_info_unittest.cc', '../webcore_unit_tests/BMPImageDecoder_unittest.cpp', '../webcore_unit_tests/ICOImageDecoder_unittest.cpp', 'event_listener_unittest.cc', @@ -514,13 +514,13 @@ '<(DEPTH)/third_party/npapi/npapi.gyp:npapi', ], 'sources': [ - '../../glue/plugins/test/npapi_constants.cc', - '../../glue/plugins/test/npapi_constants.h', - '../../glue/plugins/test/plugin_client.cc', - '../../glue/plugins/test/plugin_client.h', - '../../glue/plugins/test/plugin_test.cc', - '../../glue/plugins/test/plugin_test.h', - '../../glue/plugins/test/plugin_test_factory.h', + '../../plugins/npapi/test/npapi_constants.cc', + '../../plugins/npapi/test/npapi_constants.h', + '../../plugins/npapi/test/plugin_client.cc', + '../../plugins/npapi/test/plugin_client.h', + '../../plugins/npapi/test/plugin_test.cc', + '../../plugins/npapi/test/plugin_test.h', + '../../plugins/npapi/test/plugin_test_factory.h', ], }, { @@ -536,51 +536,51 @@ 'npapi_test_common', ], 'sources': [ - '../../glue/plugins/test/npapi_test.cc', - '../../glue/plugins/test/npapi_test.def', - '../../glue/plugins/test/npapi_test.rc', - '../../glue/plugins/test/plugin_arguments_test.cc', - '../../glue/plugins/test/plugin_arguments_test.h', - '../../glue/plugins/test/plugin_create_instance_in_paint.cc', - '../../glue/plugins/test/plugin_create_instance_in_paint.h', - '../../glue/plugins/test/plugin_delete_plugin_in_stream_test.cc', - '../../glue/plugins/test/plugin_delete_plugin_in_stream_test.h', - '../../glue/plugins/test/plugin_get_javascript_url_test.cc', - '../../glue/plugins/test/plugin_get_javascript_url_test.h', - '../../glue/plugins/test/plugin_get_javascript_url2_test.cc', - '../../glue/plugins/test/plugin_get_javascript_url2_test.h', - '../../glue/plugins/test/plugin_geturl_test.cc', - '../../glue/plugins/test/plugin_geturl_test.h', - '../../glue/plugins/test/plugin_javascript_open_popup.cc', - '../../glue/plugins/test/plugin_javascript_open_popup.h', - '../../glue/plugins/test/plugin_new_fails_test.cc', - '../../glue/plugins/test/plugin_new_fails_test.h', - '../../glue/plugins/test/plugin_npobject_lifetime_test.cc', - '../../glue/plugins/test/plugin_npobject_lifetime_test.h', - '../../glue/plugins/test/plugin_npobject_proxy_test.cc', - '../../glue/plugins/test/plugin_npobject_proxy_test.h', - '../../glue/plugins/test/plugin_schedule_timer_test.cc', - '../../glue/plugins/test/plugin_schedule_timer_test.h', - '../../glue/plugins/test/plugin_setup_test.cc', - '../../glue/plugins/test/plugin_setup_test.h', - '../../glue/plugins/test/plugin_thread_async_call_test.cc', - '../../glue/plugins/test/plugin_thread_async_call_test.h', - '../../glue/plugins/test/plugin_windowed_test.cc', - '../../glue/plugins/test/plugin_windowed_test.h', - '../../glue/plugins/test/plugin_private_test.cc', - '../../glue/plugins/test/plugin_private_test.h', - '../../glue/plugins/test/plugin_test_factory.cc', - '../../glue/plugins/test/plugin_window_size_test.cc', - '../../glue/plugins/test/plugin_window_size_test.h', - '../../glue/plugins/test/plugin_windowless_test.cc', - '../../glue/plugins/test/plugin_windowless_test.h', - '../../glue/plugins/test/resource.h', + '../../plugins/npapi/test/npapi_test.cc', + '../../plugins/npapi/test/npapi_test.def', + '../../plugins/npapi/test/npapi_test.rc', + '../../plugins/npapi/test/plugin_arguments_test.cc', + '../../plugins/npapi/test/plugin_arguments_test.h', + '../../plugins/npapi/test/plugin_create_instance_in_paint.cc', + '../../plugins/npapi/test/plugin_create_instance_in_paint.h', + '../../plugins/npapi/test/plugin_delete_plugin_in_stream_test.cc', + '../../plugins/npapi/test/plugin_delete_plugin_in_stream_test.h', + '../../plugins/npapi/test/plugin_get_javascript_url_test.cc', + '../../plugins/npapi/test/plugin_get_javascript_url_test.h', + '../../plugins/npapi/test/plugin_get_javascript_url2_test.cc', + '../../plugins/npapi/test/plugin_get_javascript_url2_test.h', + '../../plugins/npapi/test/plugin_geturl_test.cc', + '../../plugins/npapi/test/plugin_geturl_test.h', + '../../plugins/npapi/test/plugin_javascript_open_popup.cc', + '../../plugins/npapi/test/plugin_javascript_open_popup.h', + '../../plugins/npapi/test/plugin_new_fails_test.cc', + '../../plugins/npapi/test/plugin_new_fails_test.h', + '../../plugins/npapi/test/plugin_npobject_lifetime_test.cc', + '../../plugins/npapi/test/plugin_npobject_lifetime_test.h', + '../../plugins/npapi/test/plugin_npobject_proxy_test.cc', + '../../plugins/npapi/test/plugin_npobject_proxy_test.h', + '../../plugins/npapi/test/plugin_schedule_timer_test.cc', + '../../plugins/npapi/test/plugin_schedule_timer_test.h', + '../../plugins/npapi/test/plugin_setup_test.cc', + '../../plugins/npapi/test/plugin_setup_test.h', + '../../plugins/npapi/test/plugin_thread_async_call_test.cc', + '../../plugins/npapi/test/plugin_thread_async_call_test.h', + '../../plugins/npapi/test/plugin_windowed_test.cc', + '../../plugins/npapi/test/plugin_windowed_test.h', + '../../plugins/npapi/test/plugin_private_test.cc', + '../../plugins/npapi/test/plugin_private_test.h', + '../../plugins/npapi/test/plugin_test_factory.cc', + '../../plugins/npapi/test/plugin_window_size_test.cc', + '../../plugins/npapi/test/plugin_window_size_test.h', + '../../plugins/npapi/test/plugin_windowless_test.cc', + '../../plugins/npapi/test/plugin_windowless_test.h', + '../../plugins/npapi/test/resource.h', ], 'include_dirs': [ '../../..', ], 'xcode_settings': { - 'INFOPLIST_FILE': '<(DEPTH)/webkit/glue/plugins/test/Info.plist', + 'INFOPLIST_FILE': '<(DEPTH)/webkit/plugins/npapi/test/Info.plist', }, 'conditions': [ ['OS!="win"', { @@ -588,16 +588,16 @@ # TODO(port): Port these. # plugin_npobject_lifetime_test.cc has win32-isms # (HWND, CALLBACK). - '../../glue/plugins/test/plugin_npobject_lifetime_test.cc', + '../../plugins/npapi/test/plugin_npobject_lifetime_test.cc', # The window APIs are necessarily platform-specific. - '../../glue/plugins/test/plugin_window_size_test.cc', - '../../glue/plugins/test/plugin_windowed_test.cc', + '../../plugins/npapi/test/plugin_window_size_test.cc', + '../../plugins/npapi/test/plugin_windowed_test.cc', # Seems windows specific. - '../../glue/plugins/test/plugin_create_instance_in_paint.cc', - '../../glue/plugins/test/plugin_create_instance_in_paint.h', + '../../plugins/npapi/test/plugin_create_instance_in_paint.cc', + '../../plugins/npapi/test/plugin_create_instance_in_paint.h', # windows-specific resources - '../../glue/plugins/test/npapi_test.def', - '../../glue/plugins/test/npapi_test.rc', + '../../plugins/npapi/test/npapi_test.def', + '../../plugins/npapi/test/npapi_test.rc', ], }], ['OS=="mac"', { @@ -611,7 +611,7 @@ ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { 'sources!': [ # Needs simple event record type porting - '../../glue/plugins/test/plugin_windowless_test.cc', + '../../plugins/npapi/test/plugin_windowless_test.cc', ], }], ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and (target_arch=="x64" or target_arch=="arm")', { @@ -653,76 +653,6 @@ }], ], }, - { - 'target_name': 'npapi_pepper_test_plugin', - 'type': 'loadable_module', - 'mac_bundle': 1, - 'msvs_guid': '821F3B89-6AE1-4254-99CB-93C04D0A79BE', - 'dependencies': [ - '<(DEPTH)/gpu/gpu.gyp:pgl', - '<(DEPTH)/third_party/gles2_book/gles2_book.gyp:stencil_test', - 'npapi_test_common', - ], - 'sources': [ - '../npapi_pepper_test_plugin/main.cc', - '../npapi_pepper_test_plugin/pepper_3d_test.cc', - '../npapi_pepper_test_plugin/pepper_3d_test.h', - '../npapi_pepper_test_plugin/plugin.def', - '../npapi_pepper_test_plugin/plugin.rc', - '../npapi_pepper_test_plugin/test_factory.cc', - ], - 'include_dirs': [ - '../../..', - ], - 'conditions': [ - ['OS!="win"', { - # windows-specific resources - 'sources!': [ - '../npapi_pepper_test_plugin/plugin.def', - '../npapi_pepper_test_plugin/plugin.rc', - ], - }], - ['OS=="mac"', { - 'product_extension': 'plugin', - }], - ], - 'xcode_settings': { - 'INFOPLIST_FILE': '<(DEPTH)/webkit/tools/npapi_pepper_test_plugin/Info.plist', - }, - }, - { - 'target_name': 'copy_npapi_pepper_test_plugin', - 'type': 'none', - 'dependencies': [ - 'npapi_pepper_test_plugin', - ], - 'conditions': [ - ['OS=="win"', { - 'copies': [ - { - 'destination': '<(PRODUCT_DIR)/plugins', - 'files': ['<(PRODUCT_DIR)/npapi_pepper_test_plugin.dll'], - }, - ], - }], - ['OS=="mac"', { - 'copies': [ - { - 'destination': '<(PRODUCT_DIR)/plugins/', - 'files': ['<(PRODUCT_DIR)/npapi_pepper_test_plugin.plugin/'], - }, - ] - }], - ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { - 'copies': [ - { - 'destination': '<(PRODUCT_DIR)/plugins', - 'files': ['<(PRODUCT_DIR)/libnpapi_pepper_test_plugin.so'], - }, - ], - }], - ], - }, ], }], ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm index 3f95276..249ccba 100644 --- a/webkit/tools/test_shell/test_shell_mac.mm +++ b/webkit/tools/test_shell/test_shell_mac.mm @@ -33,7 +33,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" #include "webkit/tools/test_shell/mac/test_shell_webview.h" #include "webkit/tools/test_shell/resource.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" @@ -252,7 +252,7 @@ void TestShell::InitializeTestShell(bool layout_test_mode, } else { plugins_dir = plugins_dir.AppendASCII("plugins"); } - NPAPI::PluginList::Singleton()->AddExtraPluginDir(plugins_dir); + webkit::npapi::PluginList::Singleton()->AddExtraPluginDir(plugins_dir); } NSButton* MakeTestButton(NSRect* rect, NSString* title, NSView* parent) { diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 3f72f2c..7bc87e4 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -33,9 +33,6 @@ #include "third_party/WebKit/WebKit/chromium/public/WebFileError.h" #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) -#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClientMock.h" -#endif #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" #include "third_party/WebKit/WebKit/chromium/public/WebNode.h" @@ -59,14 +56,14 @@ #include "webkit/appcache/web_application_cache_host_impl.h" #include "webkit/glue/glue_serialize.h" #include "webkit/glue/media/video_renderer_impl.h" -#include "webkit/glue/plugins/webplugin_impl.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugin_delegate_impl.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webmediaplayer_impl.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/window_open_disposition.h" +#include "webkit/plugins/npapi/webplugin_impl.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" #include "webkit/tools/test_shell/accessibility_controller.h" #include "webkit/tools/test_shell/mock_spellcheck.h" #include "webkit/tools/test_shell/notification_presenter.h" @@ -77,6 +74,10 @@ #include "webkit/tools/test_shell/test_shell.h" #include "webkit/tools/test_shell/test_web_worker.h" +#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) +#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClientMock.h" +#endif + #if defined(OS_WIN) // TODO(port): make these files work everywhere. #include "webkit/tools/test_shell/drag_delegate.h" @@ -711,22 +712,22 @@ WebScreenInfo TestWebViewDelegate::screenInfo() { // WebFrameClient ------------------------------------------------------------ -WebPlugin* TestWebViewDelegate::createPlugin( - WebFrame* frame, const WebPluginParams& params) { +WebPlugin* TestWebViewDelegate::createPlugin(WebFrame* frame, + const WebPluginParams& params) { bool allow_wildcard = true; - WebPluginInfo info; + webkit::npapi::WebPluginInfo info; std::string actual_mime_type; - if (!NPAPI::PluginList::Singleton()->GetPluginInfo( + if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo( params.url, params.mimeType.utf8(), allow_wildcard, &info, &actual_mime_type) || !info.enabled) return NULL; - return new webkit_glue::WebPluginImpl( + return new webkit::npapi::WebPluginImpl( frame, params, info.path, actual_mime_type, AsWeakPtr()); } -WebWorker* TestWebViewDelegate::createWorker( - WebFrame* frame, WebWorkerClient* client) { +WebWorker* TestWebViewDelegate::createWorker(WebFrame* frame, + WebWorkerClient* client) { return new TestWebWorker(); } diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index f5d81ad..a4de21e 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -9,40 +9,39 @@ #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ #define WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ -#include "build/build_config.h" - -#if defined(OS_WIN) -#include <windows.h> -#endif - #include <map> #include <set> #include <string> -#if defined(TOOLKIT_USES_GTK) -#include <gdk/gdkcursor.h> -#endif - #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "base/weak_ptr.h" +#include "build/build_config.h" #include "third_party/WebKit/WebKit/chromium/public/WebContextMenuData.h" #include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h" #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" -#if defined(OS_MACOSX) -#include "third_party/WebKit/WebKit/chromium/public/WebPopupMenuInfo.h" -#endif #include "third_party/WebKit/WebKit/chromium/public/WebPopupType.h" #include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h" #include "webkit/glue/webcursor.h" -#include "webkit/glue/plugins/webplugin_page_delegate.h" +#include "webkit/plugins/npapi/webplugin_page_delegate.h" +#include "webkit/tools/test_shell/mock_spellcheck.h" +#include "webkit/tools/test_shell/test_navigation_controller.h" + +#if defined(OS_MACOSX) +#include "third_party/WebKit/WebKit/chromium/public/WebPopupMenuInfo.h" +#endif + #if defined(OS_WIN) +#include <windows.h> + #include "webkit/tools/test_shell/drag_delegate.h" #include "webkit/tools/test_shell/drop_delegate.h" #endif -#include "webkit/tools/test_shell/mock_spellcheck.h" -#include "webkit/tools/test_shell/test_navigation_controller.h" + +#if defined(TOOLKIT_USES_GTK) +#include <gdk/gdkcursor.h> +#endif struct WebPreferences; class GURL; @@ -60,7 +59,7 @@ struct WebWindowFeatures; class TestWebViewDelegate : public WebKit::WebViewClient, public WebKit::WebFrameClient, - public webkit_glue::WebPluginPageDelegate, + public webkit::npapi::WebPluginPageDelegate, public base::SupportsWeakPtr<TestWebViewDelegate> { public: struct CapturedContextMenuEvent { @@ -239,8 +238,8 @@ class TestWebViewDelegate : public WebKit::WebViewClient, bool create, WebKit::WebFileSystemCallbacks* callbacks); - // webkit_glue::WebPluginPageDelegate - virtual webkit_glue::WebPluginDelegate* CreatePluginDelegate( + // webkit::npapi::WebPluginPageDelegate + virtual webkit::npapi::WebPluginDelegate* CreatePluginDelegate( const FilePath& url, const std::string& mime_type); virtual void CreatedPluginWindow( @@ -248,7 +247,7 @@ class TestWebViewDelegate : public WebKit::WebViewClient, virtual void WillDestroyPluginWindow( gfx::PluginWindowHandle handle); virtual void DidMovePlugin( - const webkit_glue::WebPluginGeometry& move); + const webkit::npapi::WebPluginGeometry& move); virtual void DidStartLoadingForPlugin() {} virtual void DidStopLoadingForPlugin() {} virtual void ShowModalHTMLDialogForPlugin( diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc index 51cfde3..aff8a45 100644 --- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc +++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc @@ -21,15 +21,15 @@ #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "third_party/WebKit/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" -#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/plugins/gtk_plugin_container_manager.h" -#include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/window_open_disposition.h" -#include "webkit/glue/plugins/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/gtk_plugin_container_manager.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugin.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" #include "webkit/tools/test_shell/test_navigation_controller.h" #include "webkit/tools/test_shell/test_shell.h" @@ -197,7 +197,7 @@ void TestWebViewDelegate::runModal() { // WebPluginPageDelegate ------------------------------------------------------ -webkit_glue::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( +webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( const FilePath& path, const std::string& mime_type) { // TODO(evanm): we probably shouldn't be doing this mapping to X ids at @@ -205,7 +205,8 @@ webkit_glue::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( GdkNativeWindow plugin_parent = GDK_WINDOW_XWINDOW(shell_->webViewHost()->view_handle()->window); - return WebPluginDelegateImpl::Create(path, mime_type, plugin_parent); + return webkit::npapi::WebPluginDelegateImpl::Create( + path, mime_type, plugin_parent); } void TestWebViewDelegate::CreatedPluginWindow( @@ -219,9 +220,9 @@ void TestWebViewDelegate::WillDestroyPluginWindow( } void TestWebViewDelegate::DidMovePlugin( - const webkit_glue::WebPluginGeometry& move) { + const webkit::npapi::WebPluginGeometry& move) { WebWidgetHost* host = GetWidgetHost(); - GtkPluginContainerManager* plugin_container_manager = + webkit::npapi::GtkPluginContainerManager* plugin_container_manager = static_cast<WebViewHost*>(host)->plugin_container_manager(); plugin_container_manager->MovePluginContainer(move); } diff --git a/webkit/tools/test_shell/test_webview_delegate_win.cc b/webkit/tools/test_shell/test_webview_delegate_win.cc index 64b6a1b..83abf40 100644 --- a/webkit/tools/test_shell/test_webview_delegate_win.cc +++ b/webkit/tools/test_shell/test_webview_delegate_win.cc @@ -23,13 +23,13 @@ #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" -#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugin_delegate_impl.h" #include "webkit/glue/window_open_disposition.h" +#include "webkit/plugins/npapi/webplugin.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" #include "webkit/tools/test_shell/drag_delegate.h" #include "webkit/tools/test_shell/drop_delegate.h" #include "webkit/tools/test_shell/test_navigation_controller.h" @@ -133,14 +133,14 @@ void TestWebViewDelegate::runModal() { // WebPluginPageDelegate ------------------------------------------------------ -webkit_glue::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( +webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( const FilePath& path, const std::string& mime_type) { HWND hwnd = shell_->webViewHost()->view_handle(); if (!hwnd) return NULL; - return WebPluginDelegateImpl::Create(path, mime_type, hwnd); + return webkit::npapi::WebPluginDelegateImpl::Create(path, mime_type, hwnd); } void TestWebViewDelegate::CreatedPluginWindow( @@ -154,7 +154,7 @@ void TestWebViewDelegate::WillDestroyPluginWindow( } void TestWebViewDelegate::DidMovePlugin( - const webkit_glue::WebPluginGeometry& move) { + const webkit::npapi::WebPluginGeometry& move) { unsigned long flags = 0; if (move.rects_valid) { diff --git a/webkit/tools/test_shell/webview_host.h b/webkit/tools/test_shell/webview_host.h index 7aade20..7a47ec3 100644 --- a/webkit/tools/test_shell/webview_host.h +++ b/webkit/tools/test_shell/webview_host.h @@ -11,7 +11,7 @@ #include "webkit/tools/test_shell/webwidget_host.h" #if defined(TOOLKIT_USES_GTK) -#include "webkit/glue/plugins/gtk_plugin_container_manager.h" +#include "webkit/plugins/npapi/gtk_plugin_container_manager.h" #endif struct WebPreferences; @@ -42,7 +42,7 @@ class WebViewHost : public WebWidgetHost { // Destroy the plugin parent container when a plugin has been destroyed. void DestroyPluginContainer(gfx::PluginWindowHandle id); - GtkPluginContainerManager* plugin_container_manager() { + webkit::npapi::GtkPluginContainerManager* plugin_container_manager() { return &plugin_container_manager_; } #elif defined(OS_MACOSX) @@ -58,7 +58,7 @@ class WebViewHost : public WebWidgetHost { #if defined(TOOLKIT_USES_GTK) // Helper class that creates and moves plugin containers. - GtkPluginContainerManager plugin_container_manager_; + webkit::npapi::GtkPluginContainerManager plugin_container_manager_; #endif }; diff --git a/webkit/tools/test_shell/webview_host_gtk.cc b/webkit/tools/test_shell/webview_host_gtk.cc index 60b8a81..92a6016 100644 --- a/webkit/tools/test_shell/webview_host_gtk.cc +++ b/webkit/tools/test_shell/webview_host_gtk.cc @@ -11,8 +11,8 @@ #include "gfx/size.h" #include "skia/ext/platform_canvas.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" -#include "webkit/glue/plugins/gtk_plugin_container.h" #include "webkit/glue/webpreferences.h" +#include "webkit/plugins/npapi/gtk_plugin_container.h" #include "webkit/tools/test_shell/test_webview_delegate.h" using WebKit::WebDevToolsAgentClient; |