diff options
155 files changed, 1253 insertions, 860 deletions
diff --git a/chrome/app/framework.order b/chrome/app/framework.order index 71cb3d3..4ac4c01 100644 --- a/chrome/app/framework.order +++ b/chrome/app/framework.order @@ -30,13 +30,13 @@ __ZN22mac_plugin_interposing31NotifyBrowserOfPluginHideWindowEj6CGRect __ZN22mac_plugin_interposing28NotifyPluginOfSetThemeCursorEPvm __ZN22mac_plugin_interposing23NotifyPluginOfSetCursorEPvPK6Cursor __ZN22mac_plugin_interposing23GetPluginWindowHasFocusEPv -__ZN25CarbonPluginWindowTrackerC1Ev -__ZN25CarbonPluginWindowTrackerC2Ev -__ZN25CarbonPluginWindowTracker14SharedInstanceEv -__ZN25CarbonPluginWindowTracker28CreateDummyWindowForDelegateEPv -__ZNK25CarbonPluginWindowTracker25GetDelegateForDummyWindowEP15OpaqueWindowPtr -__ZNK25CarbonPluginWindowTracker25GetDummyWindowForDelegateEPv -__ZN25CarbonPluginWindowTracker29DestroyDummyWindowForDelegateEPvP15OpaqueWindowPtr +__ZN6webkit5npapi25CarbonPluginWindowTrackerC1Ev +__ZN6webkit5npapi25CarbonPluginWindowTrackerC2Ev +__ZN6webkit5npapi25CarbonPluginWindowTracker14SharedInstanceEv +__ZN6webkit5npapi25CarbonPluginWindowTracker28CreateDummyWindowForDelegateEPv +__ZNK6webkit5npapi25CarbonPluginWindowTracker25GetDelegateForDummyWindowEP15OpaqueWindowPtr +__ZNK6webkit5npapi25CarbonPluginWindowTracker25GetDummyWindowForDelegateEPv +__ZN6webkit5npapi25CarbonPluginWindowTracker29DestroyDummyWindowForDelegateEPvP15OpaqueWindowPtr __ZN7WebCore22narrowPrecisionToFloatIdEEfT_ __ZN7WebCore24narrowPrecisionToCGFloatIdEEfT_ __ZnwmPv diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index be9e2d2..4108f69 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -102,7 +102,6 @@ #include "chrome/browser/automation/ui_controls.h" #include "views/event.h" #include "webkit/glue/password_form.h" -#include "webkit/glue/plugins/plugin_list.h" #if defined(OS_WIN) #include "chrome/browser/external_tab_container_win.h" diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index fcc609f..129dc8f 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -75,7 +75,7 @@ #include "net/base/cookie_store.h" #include "net/url_request/url_request_context.h" #include "views/event.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" namespace { @@ -2993,10 +2993,11 @@ void TestingAutomationProvider::GetPluginsInfo( Browser* browser, DictionaryValue* args, IPC::Message* reply_message) { - std::vector<WebPluginInfo> plugins; - NPAPI::PluginList::Singleton()->GetPlugins(false, &plugins); + std::vector<webkit::npapi::WebPluginInfo> plugins; + webkit::npapi::PluginList::Singleton()->GetPlugins(false, &plugins); ListValue* items = new ListValue; - for (std::vector<WebPluginInfo>::const_iterator it = plugins.begin(); + for (std::vector<webkit::npapi::WebPluginInfo>::const_iterator it = + plugins.begin(); it != plugins.end(); ++it) { DictionaryValue* item = new DictionaryValue; @@ -3007,7 +3008,7 @@ void TestingAutomationProvider::GetPluginsInfo( item->SetBoolean("enabled", it->enabled); // Add info about mime types. ListValue* mime_types = new ListValue(); - for (std::vector<WebPluginMimeType>::const_iterator type_it = + for (std::vector<webkit::npapi::WebPluginMimeType>::const_iterator type_it = it->mime_types.begin(); type_it != it->mime_types.end(); ++type_it) { @@ -3046,7 +3047,8 @@ void TestingAutomationProvider::EnablePlugin(Browser* browser, if (!args->GetString("path", &path)) { reply.SendError("path not specified."); return; - } else if (!NPAPI::PluginList::Singleton()->EnablePlugin(FilePath(path))) { + } else if (!webkit::npapi::PluginList::Singleton()->EnablePlugin( + FilePath(path))) { reply.SendError(StringPrintf("Could not enable plugin for path %s.", path.c_str())); return; @@ -3065,7 +3067,8 @@ void TestingAutomationProvider::DisablePlugin(Browser* browser, if (!args->GetString("path", &path)) { reply.SendError("path not specified."); return; - } else if (!NPAPI::PluginList::Singleton()->DisablePlugin(FilePath(path))) { + } else if (!webkit::npapi::PluginList::Singleton()->DisablePlugin( + FilePath(path))) { reply.SendError(StringPrintf("Could not disable plugin for path %s.", path.c_str())); return; diff --git a/chrome/browser/dom_ui/plugins_ui.cc b/chrome/browser/dom_ui/plugins_ui.cc index 6746fdd..aaf59f1 100644 --- a/chrome/browser/dom_ui/plugins_ui.cc +++ b/chrome/browser/dom_ui/plugins_ui.cc @@ -32,7 +32,7 @@ #include "grit/browser_resources.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" namespace { @@ -223,7 +223,8 @@ void PluginsDOMHandler::HandleEnablePluginMessage(const ListValue* args) { plugin_updater->EnablePluginGroup(enable, group_name); if (enable) { // See http://crbug.com/50105 for background. - string16 adobereader = ASCIIToUTF16(PluginGroup::kAdobeReaderGroupName); + string16 adobereader = ASCIIToUTF16( + webkit::npapi::PluginGroup::kAdobeReaderGroupName); string16 internalpdf = ASCIIToUTF16(PepperPluginRegistry::kPDFPluginName); if (group_name == adobereader) { plugin_updater->EnablePluginGroup(false, internalpdf); diff --git a/chrome/browser/gtk/content_setting_bubble_gtk.cc b/chrome/browser/gtk/content_setting_bubble_gtk.cc index a53d69c..f8c36f0 100644 --- a/chrome/browser/gtk/content_setting_bubble_gtk.cc +++ b/chrome/browser/gtk/content_setting_bubble_gtk.cc @@ -27,7 +27,7 @@ #include "gfx/gtk_util.h" #include "grit/app_resources.h" #include "grit/generated_resources.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" namespace { @@ -109,7 +109,7 @@ void ContentSettingBubbleGtk::BuildBubble() { for (std::set<std::string>::const_iterator it = plugins.begin(); it != plugins.end(); ++it) { std::string name = UTF16ToUTF8( - NPAPI::PluginList::Singleton()->GetPluginGroupName(*it)); + webkit::npapi::PluginList::Singleton()->GetPluginGroupName(*it)); if (name.empty()) name = *it; diff --git a/chrome/browser/hang_monitor/hung_plugin_action.cc b/chrome/browser/hang_monitor/hung_plugin_action.cc index 8399464..9b719ca 100644 --- a/chrome/browser/hang_monitor/hung_plugin_action.cc +++ b/chrome/browser/hang_monitor/hung_plugin_action.cc @@ -12,7 +12,7 @@ #include "chrome/browser/platform_util.h" #include "chrome/common/logging_chrome.h" #include "grit/generated_resources.h" -#include "webkit/glue/plugins/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" HungPluginAction::HungPluginAction() : current_hung_plugin_window_(NULL) { } @@ -122,8 +122,8 @@ bool HungPluginAction::GetPluginName(HWND plugin_window, // we have gone too far. return false; } - if (WebPluginDelegateImpl::GetPluginNameFromWindow(window_to_check, - plugin_name)) { + if (webkit::npapi::WebPluginDelegateImpl::GetPluginNameFromWindow( + window_to_check, plugin_name)) { return true; } window_to_check = GetParent(window_to_check); diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc index d0a1f01..bf54134 100644 --- a/chrome/browser/metrics/metrics_log.cc +++ b/chrome/browser/metrics/metrics_log.cc @@ -25,6 +25,7 @@ #include "chrome/common/logging_chrome.h" #include "chrome/common/pref_names.h" #include "googleurl/src/gurl.h" +#include "webkit/plugins/npapi/webplugininfo.h" #define OPEN_ELEMENT_FOR_SCOPE(name) ScopedElement scoped_element(this, name) @@ -237,12 +238,13 @@ void MetricsLog::WriteRealtimeStabilityAttributes(PrefService* pref) { } void MetricsLog::WritePluginList( - const std::vector<WebPluginInfo>& plugin_list) { + const std::vector<webkit::npapi::WebPluginInfo>& plugin_list) { DCHECK(!locked_); OPEN_ELEMENT_FOR_SCOPE("plugins"); - for (std::vector<WebPluginInfo>::const_iterator iter = plugin_list.begin(); + for (std::vector<webkit::npapi::WebPluginInfo>::const_iterator iter = + plugin_list.begin(); iter != plugin_list.end(); ++iter) { OPEN_ELEMENT_FOR_SCOPE("plugin"); @@ -262,7 +264,7 @@ void MetricsLog::WriteInstallElement() { } void MetricsLog::RecordEnvironment( - const std::vector<WebPluginInfo>& plugin_list, + const std::vector<webkit::npapi::WebPluginInfo>& plugin_list, const DictionaryValue* profile_metrics) { DCHECK(!locked_); diff --git a/chrome/browser/metrics/metrics_log.h b/chrome/browser/metrics/metrics_log.h index 8f35705..0cb8b29 100644 --- a/chrome/browser/metrics/metrics_log.h +++ b/chrome/browser/metrics/metrics_log.h @@ -12,13 +12,18 @@ #include "base/basictypes.h" #include "chrome/common/metrics_helpers.h" #include "chrome/common/page_transition_types.h" -#include "webkit/glue/plugins/webplugininfo.h" struct AutocompleteLog; class DictionaryValue; class GURL; class PrefService; +namespace webkit { +namespace npapi { +struct WebPluginInfo; +} +} + class MetricsLog : public MetricsLogBase { public: // Creates a new metrics log @@ -35,8 +40,9 @@ class MetricsLog : public MetricsLogBase { // profile_metrics, if non-null, gives a dictionary of all profile metrics // that are to be recorded. Each value in profile_metrics should be a // dictionary giving the metrics for the profile. - void RecordEnvironment(const std::vector<WebPluginInfo>& plugin_list, - const DictionaryValue* profile_metrics); + void RecordEnvironment( + const std::vector<webkit::npapi::WebPluginInfo>& plugin_list, + const DictionaryValue* profile_metrics); // Records the input text, available choices, and selected entry when the // user uses the Omnibox to open a URL. @@ -80,7 +86,8 @@ class MetricsLog : public MetricsLogBase { void WriteRealtimeStabilityAttributes(PrefService* pref); // Writes the list of installed plugins. - void WritePluginList(const std::vector<WebPluginInfo>& plugin_list); + void WritePluginList( + const std::vector<webkit::npapi::WebPluginInfo>& plugin_list); // Within the profile group, write basic install info including appversion. void WriteInstallElement(); diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index 5aea04a..5e1af15 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -184,8 +184,8 @@ #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.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" #include "libxml/xmlwriter.h" // TODO(port): port browser_distribution.h. @@ -336,8 +336,9 @@ class MetricsMemoryDetails : public MemoryDetails { class MetricsService::InitTaskComplete : public Task { public: - explicit InitTaskComplete(const std::string& hardware_class, - const std::vector<WebPluginInfo>& plugins) + explicit InitTaskComplete( + const std::string& hardware_class, + const std::vector<webkit::npapi::WebPluginInfo>& plugins) : hardware_class_(hardware_class), plugins_(plugins) {} virtual void Run() { @@ -347,7 +348,7 @@ class MetricsService::InitTaskComplete : public Task { private: std::string hardware_class_; - std::vector<WebPluginInfo> plugins_; + std::vector<webkit::npapi::WebPluginInfo> plugins_; }; class MetricsService::InitTask : public Task { @@ -356,12 +357,12 @@ class MetricsService::InitTask : public Task { : callback_loop_(callback_loop) {} virtual void Run() { - std::vector<WebPluginInfo> plugins; - NPAPI::PluginList::Singleton()->GetPlugins(false, &plugins); + std::vector<webkit::npapi::WebPluginInfo> plugins; + webkit::npapi::PluginList::Singleton()->GetPlugins(false, &plugins); std::string hardware_class; // Empty string by default. #if defined(OS_CHROMEOS) chromeos::SystemLibrary* system_library = - chromeos::CrosLibrary::Get()->GetSystemLibrary(); + chromeos::CrosLibrary::Get()->GetSystemLibrary(); system_library->GetMachineStatistic("hardware_class", &hardware_class); #endif // OS_CHROMEOS callback_loop_->PostTask(FROM_HERE, new InitTaskComplete( @@ -801,7 +802,7 @@ void MetricsService::InitializeMetricsState() { void MetricsService::OnInitTaskComplete( const std::string& hardware_class, - const std::vector<WebPluginInfo>& plugins) { + const std::vector<webkit::npapi::WebPluginInfo>& plugins) { DCHECK(state_ == INIT_TASK_SCHEDULED); hardware_class_ = hardware_class; plugins_ = plugins; diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h index f1cfbb2..fa15a12 100644 --- a/chrome/browser/metrics/metrics_service.h +++ b/chrome/browser/metrics/metrics_service.h @@ -33,7 +33,12 @@ class HistogramSynchronizer; class MetricsLogBase; class PrefService; class TemplateURLModel; + +namespace webkit { +namespace npapi { struct WebPluginInfo; +} +} // Forward declaration of the xmlNode to avoid having tons of gyp files // needing to depend on the libxml third party lib. @@ -155,7 +160,7 @@ class MetricsService : public NotificationObserver, // Callback to let us know that the init task is done. void OnInitTaskComplete( const std::string& hardware_class, - const std::vector<WebPluginInfo>& plugins); + const std::vector<webkit::npapi::WebPluginInfo>& plugins); // When we start a new version of Chromium (different from our last run), we // need to discard the old crash stats so that we don't attribute crashes etc. @@ -418,7 +423,7 @@ class MetricsService : public NotificationObserver, std::string hardware_class_; // The list of plugins which was retrieved on the file thread. - std::vector<WebPluginInfo> plugins_; + std::vector<webkit::npapi::WebPluginInfo> plugins_; // The outstanding transmission appears as a URL Fetch operation. scoped_ptr<URLFetcher> current_fetch_; diff --git a/chrome/browser/mock_plugin_exceptions_table_model.cc b/chrome/browser/mock_plugin_exceptions_table_model.cc index 77b2a2f..1c88524 100644 --- a/chrome/browser/mock_plugin_exceptions_table_model.cc +++ b/chrome/browser/mock_plugin_exceptions_table_model.cc @@ -5,11 +5,11 @@ #include "chrome/browser/mock_plugin_exceptions_table_model.h" void MockPluginExceptionsTableModel::set_plugins( - std::vector<PluginGroup>& plugins) { + std::vector<webkit::npapi::PluginGroup>& plugins) { plugins_ = plugins; } void MockPluginExceptionsTableModel::GetPlugins( - std::vector<PluginGroup>* plugin_groups) { + std::vector<webkit::npapi::PluginGroup>* plugin_groups) { *plugin_groups = plugins_; } diff --git a/chrome/browser/mock_plugin_exceptions_table_model.h b/chrome/browser/mock_plugin_exceptions_table_model.h index 15a1c5b..c63d67f 100644 --- a/chrome/browser/mock_plugin_exceptions_table_model.h +++ b/chrome/browser/mock_plugin_exceptions_table_model.h @@ -17,13 +17,14 @@ class MockPluginExceptionsTableModel : public PluginExceptionsTableModel { : PluginExceptionsTableModel(map, otr_map) {} virtual ~MockPluginExceptionsTableModel() {} - void set_plugins(std::vector<PluginGroup>& plugins); + void set_plugins(std::vector<webkit::npapi::PluginGroup>& plugins); protected: - virtual void GetPlugins(std::vector<PluginGroup>* plugin_groups); + virtual void GetPlugins( + std::vector<webkit::npapi::PluginGroup>* plugin_groups); private: - std::vector<PluginGroup> plugins_; + std::vector<webkit::npapi::PluginGroup> plugins_; }; #endif // CHROME_BROWSER_MOCK_PLUGIN_EXCEPTIONS_TABLE_MODEL_H_ diff --git a/chrome/browser/plugin_carbon_interpose_mac.cc b/chrome/browser/plugin_carbon_interpose_mac.cc index 55e1405..2b60d66 100644 --- a/chrome/browser/plugin_carbon_interpose_mac.cc +++ b/chrome/browser/plugin_carbon_interpose_mac.cc @@ -8,7 +8,7 @@ #include "chrome/plugin/plugin_interpose_util_mac.h" #include "gfx/rect.h" -#include "webkit/glue/plugins/carbon_plugin_window_tracker_mac.h" +#include "webkit/plugins/npapi/carbon_plugin_window_tracker_mac.h" #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -61,16 +61,16 @@ static void OnPluginWindowSelected(WindowRef window) { static Boolean ChromePluginIsWindowActive(WindowRef window) { const OpaquePluginRef delegate = - CarbonPluginWindowTracker::SharedInstance()->GetDelegateForDummyWindow( - window); + webkit::npapi::CarbonPluginWindowTracker::SharedInstance()-> + GetDelegateForDummyWindow(window); return delegate ? IsContainingWindowActive(delegate) : IsWindowActive(window); } static Boolean ChromePluginIsWindowHilited(WindowRef window) { const OpaquePluginRef delegate = - CarbonPluginWindowTracker::SharedInstance()->GetDelegateForDummyWindow( - window); + webkit::npapi::CarbonPluginWindowTracker::SharedInstance()-> + GetDelegateForDummyWindow(window); return delegate ? IsContainingWindowActive(delegate) : IsWindowHilited(window); } @@ -126,8 +126,8 @@ static void ChromePluginDisposeDialog(DialogRef dialog) { static WindowPartCode ChromePluginFindWindow(Point point, WindowRef* window) { OpaquePluginRef delegate = mac_plugin_interposing::GetActiveDelegate(); - CarbonPluginWindowTracker* tracker = - CarbonPluginWindowTracker::SharedInstance(); + webkit::npapi::CarbonPluginWindowTracker* tracker = + webkit::npapi::CarbonPluginWindowTracker::SharedInstance(); WindowRef plugin_window = tracker->GetDummyWindowForDelegate(delegate); if (plugin_window) { // If plugin_window is non-NULL, then we are in the middle of routing an diff --git a/chrome/browser/plugin_data_remover.cc b/chrome/browser/plugin_data_remover.cc index 74aa07c..fd7d9bd 100644 --- a/chrome/browser/plugin_data_remover.cc +++ b/chrome/browser/plugin_data_remover.cc @@ -10,8 +10,8 @@ #include "chrome/browser/browser_thread.h" #include "chrome/browser/plugin_service.h" #include "chrome/common/plugin_messages.h" -#include "webkit/glue/plugins/plugin_group.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_group.h" +#include "webkit/plugins/npapi/plugin_list.h" #if defined(OS_POSIX) #include "ipc/ipc_channel_posix.h" @@ -65,7 +65,8 @@ bool PluginDataRemover::OffTheRecord() { return false; } -void PluginDataRemover::SetPluginInfo(const WebPluginInfo& info) { +void PluginDataRemover::SetPluginInfo( + const webkit::npapi::WebPluginInfo& info) { } void PluginDataRemover::OnChannelOpened(const IPC::ChannelHandle& handle) { @@ -142,16 +143,16 @@ void PluginDataRemover::SignalDone() { bool PluginDataRemover::IsSupported() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); bool allow_wildcard = false; - WebPluginInfo plugin; + webkit::npapi::WebPluginInfo plugin; std::string mime_type; - if (!NPAPI::PluginList::Singleton()->GetPluginInfo(GURL(), - g_flash_mime_type, - allow_wildcard, - &plugin, - &mime_type)) + if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo(GURL(), + g_flash_mime_type, + allow_wildcard, + &plugin, + &mime_type)) return false; scoped_ptr<Version> version( - PluginGroup::CreateVersionFromString(plugin.version)); + webkit::npapi::PluginGroup::CreateVersionFromString(plugin.version)); scoped_ptr<Version> min_version( Version::GetVersionFromString(g_min_flash_version)); return plugin.enabled && diff --git a/chrome/browser/plugin_data_remover.h b/chrome/browser/plugin_data_remover.h index 03b7e6f..58387fe 100644 --- a/chrome/browser/plugin_data_remover.h +++ b/chrome/browser/plugin_data_remover.h @@ -41,7 +41,7 @@ class PluginDataRemover : public base::RefCountedThreadSafe<PluginDataRemover>, // PluginProcessHost::Client methods virtual int ID(); virtual bool OffTheRecord(); - virtual void SetPluginInfo(const WebPluginInfo& info); + virtual void SetPluginInfo(const webkit::npapi::WebPluginInfo& info); virtual void OnChannelOpened(const IPC::ChannelHandle& handle); virtual void OnError(); diff --git a/chrome/browser/plugin_exceptions_table_model.cc b/chrome/browser/plugin_exceptions_table_model.cc index 7ad5b13..5b2a2c1 100644 --- a/chrome/browser/plugin_exceptions_table_model.cc +++ b/chrome/browser/plugin_exceptions_table_model.cc @@ -134,13 +134,13 @@ void PluginExceptionsTableModel::ClearSettings() { } void PluginExceptionsTableModel::GetPlugins( - std::vector<PluginGroup>* plugin_groups) { - NPAPI::PluginList::Singleton()->GetPluginGroups(false, plugin_groups); + std::vector<webkit::npapi::PluginGroup>* plugin_groups) { + webkit::npapi::PluginList::Singleton()->GetPluginGroups(false, plugin_groups); } void PluginExceptionsTableModel::LoadSettings() { int group_id = 0; - std::vector<PluginGroup> plugins; + std::vector<webkit::npapi::PluginGroup> plugins; GetPlugins(&plugins); for (size_t i = 0; i < plugins.size(); ++i) { std::string plugin = plugins[i].identifier(); diff --git a/chrome/browser/plugin_exceptions_table_model.h b/chrome/browser/plugin_exceptions_table_model.h index d345b95..045c218 100644 --- a/chrome/browser/plugin_exceptions_table_model.h +++ b/chrome/browser/plugin_exceptions_table_model.h @@ -13,7 +13,7 @@ #include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/remove_rows_table_model.h" #include "chrome/common/notification_observer.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" struct WebPluginInfo; @@ -48,7 +48,8 @@ class PluginExceptionsTableModel : public RemoveRowsTableModel, protected: // Subclasses can override this method for testing. - virtual void GetPlugins(std::vector<PluginGroup>* plugin_groups); + virtual void GetPlugins( + std::vector<webkit::npapi::PluginGroup>* plugin_groups); private: friend class PluginExceptionsTableModelTest; diff --git a/chrome/browser/plugin_exceptions_table_model_unittest.cc b/chrome/browser/plugin_exceptions_table_model_unittest.cc index b96f3fb..e7efcca 100644 --- a/chrome/browser/plugin_exceptions_table_model_unittest.cc +++ b/chrome/browser/plugin_exceptions_table_model_unittest.cc @@ -13,8 +13,8 @@ #include "chrome/test/testing_profile.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/glue/plugins/plugin_group.h" -#include "webkit/glue/plugins/webplugininfo.h" +#include "webkit/plugins/npapi/plugin_group.h" +#include "webkit/plugins/npapi/webplugininfo.h" // Can't be an internal namespace because PluginExceptionsTableModel declares // as a friend. @@ -85,21 +85,21 @@ class PluginExceptionsTableModelTest : public testing::Test { table_model_.reset(new MockPluginExceptionsTableModel(map, NULL)); - std::vector<PluginGroup> plugins; - WebPluginInfo foo_plugin; + std::vector<webkit::npapi::PluginGroup> plugins; + webkit::npapi::WebPluginInfo foo_plugin; foo_plugin.path = FilePath(FILE_PATH_LITERAL("a-foo")); foo_plugin.name = ASCIIToUTF16("FooPlugin"); foo_plugin.enabled = true; - scoped_ptr<PluginGroup> foo_group( - PluginGroup::FromWebPluginInfo(foo_plugin)); + scoped_ptr<webkit::npapi::PluginGroup> foo_group( + webkit::npapi::PluginGroup::FromWebPluginInfo(foo_plugin)); plugins.push_back(*foo_group); - WebPluginInfo bar_plugin; + webkit::npapi::WebPluginInfo bar_plugin; bar_plugin.path = FilePath(FILE_PATH_LITERAL("b-bar")); bar_plugin.name = ASCIIToUTF16("BarPlugin"); bar_plugin.enabled = true; - scoped_ptr<PluginGroup> bar_group( - PluginGroup::FromWebPluginInfo(bar_plugin)); + scoped_ptr<webkit::npapi::PluginGroup> bar_group( + webkit::npapi::PluginGroup::FromWebPluginInfo(bar_plugin)); plugins.push_back(*bar_group); table_model_->set_plugins(plugins); diff --git a/chrome/browser/plugin_installer.cc b/chrome/browser/plugin_installer.cc index b6ceb3c..8d63679 100644 --- a/chrome/browser/plugin_installer.cc +++ b/chrome/browser/plugin_installer.cc @@ -12,7 +12,7 @@ #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" -#include "webkit/glue/plugins/default_plugin_shared.h" +#include "webkit/plugins/npapi/default_plugin_shared.h" // The URL for the "Problems installing" page for the Plugins infobar. static const char kLearnMorePluginInstallerUrl[] = @@ -30,11 +30,11 @@ PluginInstaller::~PluginInstaller() { void PluginInstaller::OnMissingPluginStatus(int status) { switch (status) { - case default_plugin::MISSING_PLUGIN_AVAILABLE: { + case webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE: { tab_contents_->AddInfoBar(this); break; } - case default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD: { + case webkit::npapi::default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD: { // Hide the InfoBar if user already started download/install of the // missing plugin. tab_contents_->RemoveInfoBar(this); diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index 0e7735a..72d8aed 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -169,7 +169,7 @@ PluginProcessHost::~PluginProcessHost() { CancelRequests(); } -bool PluginProcessHost::Init(const WebPluginInfo& info, +bool PluginProcessHost::Init(const webkit::npapi::WebPluginInfo& info, const std::string& locale) { info_ = info; set_name(UTF16ToWideHack(info_.name)); diff --git a/chrome/browser/plugin_process_host.h b/chrome/browser/plugin_process_host.h index 89e368a..b98840e 100644 --- a/chrome/browser/plugin_process_host.h +++ b/chrome/browser/plugin_process_host.h @@ -18,7 +18,7 @@ #include "chrome/browser/browser_child_process_host.h" #include "chrome/browser/net/resolve_proxy_msg_helper.h" #include "gfx/native_widget_types.h" -#include "webkit/glue/plugins/webplugininfo.h" +#include "webkit/plugins/npapi/webplugininfo.h" namespace gfx { class Rect; @@ -47,7 +47,7 @@ class PluginProcessHost : public BrowserChildProcessHost, // the channel. virtual int ID() = 0; virtual bool OffTheRecord() = 0; - virtual void SetPluginInfo(const WebPluginInfo& info) = 0; + virtual void SetPluginInfo(const webkit::npapi::WebPluginInfo& info) = 0; // The client should delete itself when one of these methods is called. virtual void OnChannelOpened(const IPC::ChannelHandle& handle) = 0; virtual void OnError() = 0; @@ -61,7 +61,7 @@ class PluginProcessHost : public BrowserChildProcessHost, // Initialize the new plugin process, returning true on success. This must // be called before the object can be used. - bool Init(const WebPluginInfo& info, const std::string& locale); + bool Init(const webkit::npapi::WebPluginInfo& info, const std::string& locale); // Force the plugin process to shutdown (cleanly). virtual void ForceShutdown(); @@ -92,7 +92,7 @@ class PluginProcessHost : public BrowserChildProcessHost, void OnAppActivation(); #endif - const WebPluginInfo& info() const { return info_; } + const webkit::npapi::WebPluginInfo& info() const { return info_; } #if defined(OS_WIN) // Tracks plugin parent windows created on the browser UI thread. @@ -150,7 +150,7 @@ class PluginProcessHost : public BrowserChildProcessHost, std::queue<Client*> sent_requests_; // Information about the plugin. - WebPluginInfo info_; + webkit::npapi::WebPluginInfo info_; // Helper class for handling PluginProcessHost_ResolveProxy messages (manages // the requests to the proxy service). diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc index 548bd3c..50677f7 100644 --- a/chrome/browser/plugin_service.cc +++ b/chrome/browser/plugin_service.cc @@ -34,12 +34,13 @@ #include "chrome/common/plugin_messages.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" +#include "webkit/plugins/npapi/plugin_constants_win.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugininfo.h" + #ifndef DISABLE_NACL #include "native_client/src/trusted/plugin/nacl_entry_points.h" #endif -#include "webkit/glue/plugins/plugin_constants_win.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugininfo.h" #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/plugin_selection_policy.h" @@ -94,10 +95,10 @@ PluginService::PluginService() const CommandLine* command_line = CommandLine::ForCurrentProcess(); FilePath path = command_line->GetSwitchValuePath(switches::kLoadPlugin); if (!path.empty()) - NPAPI::PluginList::Singleton()->AddExtraPluginPath(path); + webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); path = command_line->GetSwitchValuePath(switches::kExtraPluginDir); if (!path.empty()) - NPAPI::PluginList::Singleton()->AddExtraPluginDir(path); + webkit::npapi::PluginList::Singleton()->AddExtraPluginDir(path); chrome::RegisterInternalDefaultPlugin(); @@ -105,7 +106,7 @@ PluginService::PluginService() if (!CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableInternalFlash) && PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { - NPAPI::PluginList::Singleton()->AddExtraPluginPath(path); + webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); } #ifndef DISABLE_NACL @@ -123,9 +124,9 @@ PluginService::PluginService() #if defined(OS_WIN) hkcu_key_.Create( - HKEY_CURRENT_USER, kRegistryMozillaPlugins, KEY_NOTIFY); + HKEY_CURRENT_USER, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); hklm_key_.Create( - HKEY_LOCAL_MACHINE, kRegistryMozillaPlugins, KEY_NOTIFY); + HKEY_LOCAL_MACHINE, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); if (hkcu_key_.StartWatching()) { hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event())); hkcu_watcher_.StartWatching(hkcu_event_.get(), this); @@ -140,7 +141,7 @@ PluginService::PluginService() // e.g. ~/.config/chromium/Plugins. FilePath user_data_dir; if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { - NPAPI::PluginList::Singleton()->AddExtraPluginDir( + webkit::npapi::PluginList::Singleton()->AddExtraPluginDir( user_data_dir.Append("Plugins")); } #endif @@ -212,9 +213,9 @@ PluginProcessHost* PluginService::FindOrStartPluginProcess( if (plugin_host) return plugin_host; - WebPluginInfo info; - if (!NPAPI::PluginList::Singleton()->GetPluginInfoByPath( - plugin_path, &info)) { + webkit::npapi::WebPluginInfo info; + if (!webkit::npapi::PluginList::Singleton()->GetPluginInfoByPath( + plugin_path, &info)) { return NULL; } @@ -246,7 +247,7 @@ void PluginService::GetAllowedPluginForOpenChannelToPlugin( const std::string& mime_type, PluginProcessHost::Client* client) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - WebPluginInfo info; + webkit::npapi::WebPluginInfo info; bool found = GetFirstAllowedPluginInfo(url, mime_type, &info, NULL); FilePath plugin_path; if (found && info.enabled) @@ -275,16 +276,16 @@ void PluginService::FinishOpenChannelToPlugin( bool PluginService::GetFirstAllowedPluginInfo( const GURL& url, const std::string& mime_type, - WebPluginInfo* info, + webkit::npapi::WebPluginInfo* info, std::string* actual_mime_type) { // GetPluginInfoArray may need to load the plugins, so we need to be // on the FILE thread. DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); bool allow_wildcard = true; #if defined(OS_CHROMEOS) - std::vector<WebPluginInfo> info_array; + std::vector<webkit::npapi::WebPluginInfo> info_array; std::vector<std::string> actual_mime_types; - NPAPI::PluginList::Singleton()->GetPluginInfoArray( + webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( url, mime_type, allow_wildcard, &info_array, &actual_mime_types); // Now we filter by the plugin selection policy. @@ -298,7 +299,7 @@ bool PluginService::GetFirstAllowedPluginInfo( } return false; #else - return NPAPI::PluginList::Singleton()->GetPluginInfo( + return webkit::npapi::PluginList::Singleton()->GetPluginInfo( url, mime_type, allow_wildcard, info, actual_mime_type); #endif } @@ -319,7 +320,7 @@ void PluginService::OnWaitableEventSignaled( hklm_key_.StartWatching(); } - NPAPI::PluginList::Singleton()->RefreshPlugins(); + webkit::npapi::PluginList::Singleton()->RefreshPlugins(); PurgePluginListCache(true); #endif // defined(OS_WIN) } @@ -340,8 +341,8 @@ void PluginService::Observe(NotificationType type, bool plugins_changed = false; for (size_t i = 0; i < extension->plugins().size(); ++i) { const Extension::PluginInfo& plugin = extension->plugins()[i]; - NPAPI::PluginList::Singleton()->RefreshPlugins(); - NPAPI::PluginList::Singleton()->AddExtraPluginPath(plugin.path); + webkit::npapi::PluginList::Singleton()->RefreshPlugins(); + webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(plugin.path); plugins_changed = true; if (!plugin.is_public) private_plugins_[plugin.path] = extension->url(); @@ -359,8 +360,9 @@ void PluginService::Observe(NotificationType type, BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, NewRunnableFunction(&ForceShutdownPlugin, plugin.path)); - NPAPI::PluginList::Singleton()->RefreshPlugins(); - NPAPI::PluginList::Singleton()->RemoveExtraPluginPath(plugin.path); + webkit::npapi::PluginList::Singleton()->RefreshPlugins(); + webkit::npapi::PluginList::Singleton()->RemoveExtraPluginPath( + plugin.path); plugins_changed = true; if (!plugin.is_public) private_plugins_.erase(plugin.path); @@ -407,7 +409,7 @@ void PluginService::RegisterPepperPlugins() { std::vector<PepperPluginInfo> plugins; PepperPluginRegistry::GetList(&plugins); for (size_t i = 0; i < plugins.size(); ++i) { - NPAPI::PluginVersionInfo info; + webkit::npapi::PluginVersionInfo info; info.path = plugins[i].path; info.product_name = plugins[i].name.empty() ? plugins[i].path.BaseName().ToWStringHack() : @@ -422,6 +424,6 @@ void PluginService::RegisterPepperPlugins() { // or perhaps refactor the PluginList to be less specific to NPAPI. memset(&info.entry_points, 0, sizeof(info.entry_points)); - NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); + webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info); } } diff --git a/chrome/browser/plugin_service.h b/chrome/browser/plugin_service.h index e83e804..a66d76ac 100644 --- a/chrome/browser/plugin_service.h +++ b/chrome/browser/plugin_service.h @@ -41,7 +41,13 @@ class MessageLoop; class Profile; class ResourceDispatcherHost; class URLRequestContext; + + +namespace webkit { +namespace npapi { struct WebPluginInfo; +} +} // This must be created on the main thread but it's only called on the IO/file // thread. @@ -90,7 +96,7 @@ class PluginService // the given url and mime type. Must be called on the FILE thread. bool GetFirstAllowedPluginInfo(const GURL& url, const std::string& mime_type, - WebPluginInfo* info, + webkit::npapi::WebPluginInfo* info, std::string* actual_mime_type); // Returns true if the given plugin is allowed to be used by a page with diff --git a/chrome/browser/plugin_service_browsertest.cc b/chrome/browser/plugin_service_browsertest.cc index 8d9e82e..5fed897 100644 --- a/chrome/browser/plugin_service_browsertest.cc +++ b/chrome/browser/plugin_service_browsertest.cc @@ -11,7 +11,7 @@ #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/gmock/include/gmock/gmock.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" namespace { @@ -26,7 +26,7 @@ class MockPluginProcessHostClient : public PluginProcessHost::Client { MOCK_METHOD0(ID, int()); MOCK_METHOD0(OffTheRecord, bool()); - MOCK_METHOD1(SetPluginInfo, void(const WebPluginInfo& info)); + MOCK_METHOD1(SetPluginInfo, void(const webkit::npapi::WebPluginInfo& info)); MOCK_METHOD1(OnChannelOpened, void(const IPC::ChannelHandle& handle)); MOCK_METHOD0(OnError, void()); @@ -73,10 +73,10 @@ IN_PROC_BROWSER_TEST_F(PluginServiceTest, StartAndFindPluginProcess) { // calls to FindPluginProcess should return non-zero values. PluginProcessHost* default_plugin_process_host = plugin_service_->FindOrStartPluginProcess( - FilePath(kDefaultPluginLibraryName)); + FilePath(webkit::npapi::kDefaultPluginLibraryName)); - EXPECT_EQ(default_plugin_process_host, - plugin_service_->FindPluginProcess(FilePath(kDefaultPluginLibraryName))); + EXPECT_EQ(default_plugin_process_host, plugin_service_->FindPluginProcess( + FilePath(webkit::npapi::kDefaultPluginLibraryName))); } IN_PROC_BROWSER_TEST_F(PluginServiceTest, OpenChannelToPlugin) { @@ -95,7 +95,7 @@ IN_PROC_BROWSER_TEST_F(PluginServiceTest, GetFirstAllowedPluginInfo) { // We should always get a positive response no matter whether we really have // a plugin to support that particular mime type because the Default plugin // supports all mime types. - WebPluginInfo plugin_info; + webkit::npapi::WebPluginInfo plugin_info; std::string plugin_mime_type; plugin_service_->GetFirstAllowedPluginInfo(GURL("http://google.com/"), "application/pdf", diff --git a/chrome/browser/plugin_service_unittest.cc b/chrome/browser/plugin_service_unittest.cc index 4e54526..6950d2a 100644 --- a/chrome/browser/plugin_service_unittest.cc +++ b/chrome/browser/plugin_service_unittest.cc @@ -9,7 +9,6 @@ #include "chrome/browser/browser_thread.h" #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/glue/plugins/plugin_list.h" namespace { diff --git a/chrome/browser/plugin_updater.cc b/chrome/browser/plugin_updater.cc index 40f3be1..d994efd 100644 --- a/chrome/browser/plugin_updater.cc +++ b/chrome/browser/plugin_updater.cc @@ -22,7 +22,8 @@ #include "chrome/common/notification_service.h" #include "chrome/common/pepper_plugin_registry.h" #include "chrome/common/pref_names.h" -#include "webkit/glue/plugins/webplugininfo.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugininfo.h" // How long to wait to save the plugin enabled information, which might need to // go to disk. @@ -34,7 +35,7 @@ PluginUpdater::PluginUpdater() } DictionaryValue* PluginUpdater::CreatePluginFileSummary( - const WebPluginInfo& plugin) { + const webkit::npapi::WebPluginInfo& plugin) { DictionaryValue* data = new DictionaryValue(); data->SetString("path", plugin.path.value()); data->SetString("name", plugin.name); @@ -45,8 +46,8 @@ DictionaryValue* PluginUpdater::CreatePluginFileSummary( // static ListValue* PluginUpdater::GetPluginGroupsData() { - std::vector<PluginGroup> plugin_groups; - NPAPI::PluginList::Singleton()->GetPluginGroups(true, &plugin_groups); + std::vector<webkit::npapi::PluginGroup> plugin_groups; + webkit::npapi::PluginList::Singleton()->GetPluginGroups(true, &plugin_groups); // Construct DictionaryValues to return to the UI ListValue* plugin_groups_data = new ListValue(); @@ -57,19 +58,20 @@ ListValue* PluginUpdater::GetPluginGroupsData() { } void PluginUpdater::EnablePluginGroup(bool enable, const string16& group_name) { - if (PluginGroup::IsPluginNameDisabledByPolicy(group_name)) + if (webkit::npapi::PluginGroup::IsPluginNameDisabledByPolicy(group_name)) enable = false; - NPAPI::PluginList::Singleton()->EnableGroup(enable, group_name); + webkit::npapi::PluginList::Singleton()->EnableGroup(enable, group_name); NotifyPluginStatusChanged(); } void PluginUpdater::EnablePluginFile(bool enable, const FilePath::StringType& path) { FilePath file_path(path); - if (enable && !PluginGroup::IsPluginPathDisabledByPolicy(file_path)) - NPAPI::PluginList::Singleton()->EnablePlugin(file_path); + if (enable && + !webkit::npapi::PluginGroup::IsPluginPathDisabledByPolicy(file_path)) + webkit::npapi::PluginList::Singleton()->EnablePlugin(file_path); else - NPAPI::PluginList::Singleton()->DisablePlugin(file_path); + webkit::npapi::PluginList::Singleton()->DisablePlugin(file_path); NotifyPluginStatusChanged(); } @@ -105,7 +107,8 @@ void PluginUpdater::DisablePluginsFromPolicy(const ListValue* plugin_names) { } } } - PluginGroup::SetPolicyDisabledPluginPatterns(policy_disabled_plugin_patterns); + webkit::npapi::PluginGroup::SetPolicyDisabledPluginPatterns( + policy_disabled_plugin_patterns); NotifyPluginStatusChanged(); } @@ -190,7 +193,7 @@ void PluginUpdater::DisablePluginGroupsFromPrefs(Profile* profile) { } } if (!enabled) - NPAPI::PluginList::Singleton()->DisablePlugin(plugin_path); + webkit::npapi::PluginList::Singleton()->DisablePlugin(plugin_path); } else if (!enabled && plugin->GetString("name", &group_name)) { // Don't disable this group if it's for the pdf plugin and we just // forced it on. @@ -213,13 +216,14 @@ void PluginUpdater::DisablePluginGroupsFromPrefs(Profile* profile) { !force_internal_pdf_for_this_run) { // The internal PDF plugin is disabled by default, and the user hasn't // overridden the default. - NPAPI::PluginList::Singleton()->DisablePlugin(pdf_path); + webkit::npapi::PluginList::Singleton()->DisablePlugin(pdf_path); EnablePluginGroup(false, pdf_group_name); } if (force_enable_internal_pdf) { // See http://crbug.com/50105 for background. - EnablePluginGroup(false, ASCIIToUTF16(PluginGroup::kAdobeReaderGroupName)); + EnablePluginGroup(false, ASCIIToUTF16( + webkit::npapi::PluginGroup::kAdobeReaderGroupName)); // We want to save this, but doing so requires loading the list of plugins, // so do it after a minute as to not impact startup performance. Note that @@ -237,11 +241,11 @@ void PluginUpdater::UpdatePreferences(Profile* profile, int delay_ms) { } void PluginUpdater::GetPreferencesDataOnFileThread(void* profile) { - std::vector<WebPluginInfo> plugins; - NPAPI::PluginList::Singleton()->GetPlugins(false, &plugins); + std::vector<webkit::npapi::WebPluginInfo> plugins; + webkit::npapi::PluginList::Singleton()->GetPlugins(false, &plugins); - std::vector<PluginGroup> groups; - NPAPI::PluginList::Singleton()->GetPluginGroups(false, &groups); + std::vector<webkit::npapi::PluginGroup> groups; + webkit::npapi::PluginList::Singleton()->GetPluginGroups(false, &groups); BrowserThread::PostTask( BrowserThread::UI, @@ -253,8 +257,8 @@ void PluginUpdater::GetPreferencesDataOnFileThread(void* profile) { void PluginUpdater::OnUpdatePreferences( Profile* profile, - const std::vector<WebPluginInfo>& plugins, - const std::vector<PluginGroup>& groups) { + const std::vector<webkit::npapi::WebPluginInfo>& plugins, + const std::vector<webkit::npapi::PluginGroup>& groups) { ListValue* plugins_list = profile->GetPrefs()->GetMutableList( prefs::kPluginsPluginsList); plugins_list->Clear(); @@ -265,7 +269,8 @@ void PluginUpdater::OnUpdatePreferences( internal_dir); // Add the plugin files. - for (std::vector<WebPluginInfo>::const_iterator it = plugins.begin(); + for (std::vector<webkit::npapi::WebPluginInfo>::const_iterator it = + plugins.begin(); it != plugins.end(); ++it) { plugins_list->Append(CreatePluginFileSummary(*it)); diff --git a/chrome/browser/plugin_updater.h b/chrome/browser/plugin_updater.h index 5264334..dc18595 100644 --- a/chrome/browser/plugin_updater.h +++ b/chrome/browser/plugin_updater.h @@ -12,15 +12,19 @@ #include "base/file_path.h" #include "base/singleton.h" #include "chrome/common/notification_observer.h" -#include "webkit/glue/plugins/plugin_list.h" class DictionaryValue; class ListValue; class NotificationDetails; class NotificationSource; -class PluginGroup; class Profile; + +namespace webkit { +namespace npapi { +class PluginGroup; struct WebPluginInfo; +} +} class PluginUpdater : public NotificationObserver { public: @@ -58,8 +62,8 @@ class PluginUpdater : public NotificationObserver { // Called on the UI thread with the plugin data to save the preferences. static void OnUpdatePreferences( Profile* profile, - const std::vector<WebPluginInfo>& plugins, - const std::vector<PluginGroup>& groups); + const std::vector<webkit::npapi::WebPluginInfo>& plugins, + const std::vector<webkit::npapi::PluginGroup>& groups); // Queues sending the notification that plugin data has changed. This is done // so that if a bunch of changes happen, we only send one notification. @@ -68,7 +72,8 @@ class PluginUpdater : public NotificationObserver { // Used for the post task to notify that plugin enabled status changed. static void OnNotifyPluginStatusChanged(); - static DictionaryValue* CreatePluginFileSummary(const WebPluginInfo& plugin); + static DictionaryValue* CreatePluginFileSummary( + const webkit::npapi::WebPluginInfo& plugin); // Force plugins to be disabled due to policy. |plugins| contains // the list of StringValues of the names of the policy-disabled plugins. diff --git a/chrome/browser/renderer_host/accelerated_surface_container_mac.cc b/chrome/browser/renderer_host/accelerated_surface_container_mac.cc index 1a7c07c..f379931 100644 --- a/chrome/browser/renderer_host/accelerated_surface_container_mac.cc +++ b/chrome/browser/renderer_host/accelerated_surface_container_mac.cc @@ -7,7 +7,7 @@ #include "app/surface/io_surface_support_mac.h" #include "base/logging.h" #include "chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/webplugin.h" AcceleratedSurfaceContainerMac::AcceleratedSurfaceContainerMac( AcceleratedSurfaceContainerManagerMac* manager, @@ -51,7 +51,7 @@ void AcceleratedSurfaceContainerMac::SetSizeAndTransportDIB( } void AcceleratedSurfaceContainerMac::SetGeometry( - const webkit_glue::WebPluginGeometry& geom) { + const webkit::npapi::WebPluginGeometry& geom) { visible_ = geom.visible; if (geom.rects_valid) clip_rect_ = geom.clip_rect; diff --git a/chrome/browser/renderer_host/accelerated_surface_container_mac.h b/chrome/browser/renderer_host/accelerated_surface_container_mac.h index deda9ef..45979e0 100644 --- a/chrome/browser/renderer_host/accelerated_surface_container_mac.h +++ b/chrome/browser/renderer_host/accelerated_surface_container_mac.h @@ -36,9 +36,11 @@ #include "gfx/native_widget_types.h" #include "gfx/rect.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { struct WebPluginGeometry; } +} class AcceleratedSurfaceContainerManagerMac; @@ -65,7 +67,7 @@ class AcceleratedSurfaceContainerMac { // currently only pays attention to the clip width and height, since the // view in which it is hosted is responsible for positioning it on the // page.) - void SetGeometry(const webkit_glue::WebPluginGeometry& geom); + void SetGeometry(const webkit::npapi::WebPluginGeometry& geom); // Draws this accelerated surface's contents, texture mapped onto a quad in // the given OpenGL context. TODO(kbr): figure out and define exactly how the diff --git a/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc b/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc index 1ad09ba..a96782b 100644 --- a/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc +++ b/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc @@ -6,7 +6,7 @@ #include "base/logging.h" #include "chrome/browser/renderer_host/accelerated_surface_container_mac.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/webplugin.h" AcceleratedSurfaceContainerManagerMac::AcceleratedSurfaceContainerManagerMac() : current_id_(0), @@ -86,7 +86,7 @@ void AcceleratedSurfaceContainerManagerMac::SetSizeAndTransportDIB( } void AcceleratedSurfaceContainerManagerMac::SetPluginContainerGeometry( - const webkit_glue::WebPluginGeometry& move) { + const webkit::npapi::WebPluginGeometry& move) { AutoLock lock(lock_); AcceleratedSurfaceContainerMac* container = MapIDToContainer(move.window); diff --git a/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h b/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h index a03a5c4..a2855a4 100644 --- a/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h +++ b/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h @@ -14,9 +14,11 @@ #include "base/lock.h" #include "gfx/native_widget_types.h" -namespace webkit_glue { +namespace webkit { +namespace npapi { struct WebPluginGeometry; } +} class AcceleratedSurfaceContainerMac; @@ -63,7 +65,8 @@ class AcceleratedSurfaceContainerManagerMac { // Takes an update from WebKit about a plugin's position and size and moves // the plugin accordingly. - void SetPluginContainerGeometry(const webkit_glue::WebPluginGeometry& move); + void SetPluginContainerGeometry( + const webkit::npapi::WebPluginGeometry& move); // Draws the plugin container associated with the given id into the given // OpenGL context, which must already be current. diff --git a/chrome/browser/renderer_host/buffered_resource_handler.cc b/chrome/browser/renderer_host/buffered_resource_handler.cc index 82ca861..bc35c42 100644 --- a/chrome/browser/renderer_host/buffered_resource_handler.cc +++ b/chrome/browser/renderer_host/buffered_resource_handler.cc @@ -22,7 +22,7 @@ #include "net/base/mime_util.h" #include "net/base/net_errors.h" #include "net/http/http_response_headers.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" namespace { @@ -422,18 +422,18 @@ bool BufferedResourceHandler::ShouldDownload(bool* need_plugin_list) { return false; if (need_plugin_list) { - if (!NPAPI::PluginList::Singleton()->PluginsLoaded()) { + if (!webkit::npapi::PluginList::Singleton()->PluginsLoaded()) { *need_plugin_list = true; return true; } } else { - DCHECK(NPAPI::PluginList::Singleton()->PluginsLoaded()); + DCHECK(webkit::npapi::PluginList::Singleton()->PluginsLoaded()); } // Finally, check the plugin list. - WebPluginInfo info; + webkit::npapi::WebPluginInfo info; bool allow_wildcard = false; - return !NPAPI::PluginList::Singleton()->GetPluginInfo( + return !webkit::npapi::PluginList::Singleton()->GetPluginInfo( GURL(), type, allow_wildcard, &info, NULL) || !info.enabled; } @@ -469,8 +469,8 @@ void BufferedResourceHandler::UseAlternateResourceHandler( } void BufferedResourceHandler::LoadPlugins() { - std::vector<WebPluginInfo> plugins; - NPAPI::PluginList::Singleton()->GetPlugins(false, &plugins); + std::vector<webkit::npapi::WebPluginInfo> plugins; + webkit::npapi::PluginList::Singleton()->GetPlugins(false, &plugins); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, diff --git a/chrome/browser/renderer_host/render_message_filter.cc b/chrome/browser/renderer_host/render_message_filter.cc index ad49440..453e5c5 100644 --- a/chrome/browser/renderer_host/render_message_filter.cc +++ b/chrome/browser/renderer_host/render_message_filter.cc @@ -65,11 +65,11 @@ #include "net/url_request/url_request_context.h" #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h" #include "webkit/glue/context_menu.h" -#include "webkit/glue/plugins/plugin_group.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/webcookie.h" #include "webkit/glue/webkit_glue.h" +#include "webkit/plugins/npapi/plugin_group.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugin.h" #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/plugin_selection_policy.h" @@ -200,7 +200,7 @@ class OpenChannelToPluginCallback : public PluginProcessHost::Client { return filter_->off_the_record(); } - virtual void SetPluginInfo(const WebPluginInfo& info) { + virtual void SetPluginInfo(const webkit::npapi::WebPluginInfo& info) { info_ = info; } @@ -223,7 +223,7 @@ class OpenChannelToPluginCallback : public PluginProcessHost::Client { scoped_refptr<RenderMessageFilter> filter_; IPC::Message* reply_msg_; - WebPluginInfo info_; + webkit::npapi::WebPluginInfo info_; }; } // namespace @@ -684,8 +684,8 @@ void RenderMessageFilter::OnGetPlugins(bool refresh, void RenderMessageFilter::OnGetPluginsOnFileThread( bool refresh, IPC::Message* reply_msg) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - std::vector<WebPluginInfo> plugins; - NPAPI::PluginList::Singleton()->GetEnabledPlugins(refresh, &plugins); + std::vector<webkit::npapi::WebPluginInfo> plugins; + webkit::npapi::PluginList::Singleton()->GetEnabledPlugins(refresh, &plugins); ViewHostMsg_GetPlugins::WriteReplyParams(reply_msg, plugins); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -711,7 +711,7 @@ void RenderMessageFilter::OnGetPluginInfoOnFileThread( const std::string& mime_type, IPC::Message* reply_msg) { std::string actual_mime_type; - WebPluginInfo info; + webkit::npapi::WebPluginInfo info; bool found = plugin_service_->GetFirstAllowedPluginInfo(url, mime_type, &info, @@ -723,18 +723,20 @@ void RenderMessageFilter::OnGetPluginInfoOnFileThread( found, info, actual_mime_type, policy_url, reply_msg)); } -void RenderMessageFilter::OnGotPluginInfo(bool found, - const WebPluginInfo& info, - const std::string& actual_mime_type, - const GURL& policy_url, - IPC::Message* reply_msg) { +void RenderMessageFilter::OnGotPluginInfo( + bool found, + const webkit::npapi::WebPluginInfo& info, + const std::string& actual_mime_type, + const GURL& policy_url, + IPC::Message* reply_msg) { ContentSetting setting = CONTENT_SETTING_DEFAULT; - WebPluginInfo info_copy = info; + webkit::npapi::WebPluginInfo info_copy = info; if (found) { info_copy.enabled = info_copy.enabled && plugin_service_->PrivatePluginAllowedForURL(info_copy.path, policy_url); std::string resource = - NPAPI::PluginList::Singleton()->GetPluginGroupIdentifier(info_copy); + webkit::npapi::PluginList::Singleton()->GetPluginGroupIdentifier( + info_copy); setting = content_settings_->GetContentSetting( policy_url, CONTENT_SETTINGS_TYPE_PLUGINS, diff --git a/chrome/browser/renderer_host/render_message_filter.h b/chrome/browser/renderer_host/render_message_filter.h index 9a8a745..5c988b8 100644 --- a/chrome/browser/renderer_host/render_message_filter.h +++ b/chrome/browser/renderer_host/render_message_filter.h @@ -41,7 +41,12 @@ class RenderWidgetHelper; class URLRequestContextGetter; struct ViewHostMsg_CreateWindow_Params; struct ViewHostMsg_CreateWorker_Params; + +namespace webkit { +namespace npapi { struct WebPluginInfo; +} +} namespace base { class SharedMemory; @@ -153,7 +158,7 @@ class RenderMessageFilter : public BrowserMessageFilter, const std::string& mime_type, IPC::Message* reply_msg); void OnGotPluginInfo(bool found, - const WebPluginInfo& info, + const webkit::npapi::WebPluginInfo& info, const std::string& actual_mime_type, const GURL& policy_url, IPC::Message* reply_msg); diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index 3c71440b..b4bb0e2 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -22,8 +22,8 @@ #include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" #include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h" -#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/webcursor.h" +#include "webkit/plugins/npapi/webplugin.h" #if defined(TOOLKIT_VIEWS) #include "views/view.h" diff --git a/chrome/browser/renderer_host/render_widget_host_view.h b/chrome/browser/renderer_host/render_widget_host_view.h index fdbe440..2d4b1ea 100644 --- a/chrome/browser/renderer_host/render_widget_host_view.h +++ b/chrome/browser/renderer_host/render_widget_host_view.h @@ -39,8 +39,13 @@ struct ViewHostMsg_AccessibilityNotification_Params; namespace webkit_glue { struct WebAccessibility; +} + +namespace webkit { +namespace npapi { struct WebPluginGeometry; } +} // RenderWidgetHostView is an interface implemented by an object that acts as // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its @@ -97,7 +102,7 @@ class RenderWidgetHostView { // Moves all plugin windows as described in the given list. virtual void MovePluginWindows( - const std::vector<webkit_glue::WebPluginGeometry>& moves) = 0; + const std::vector<webkit::npapi::WebPluginGeometry>& moves) = 0; // Actually set/take focus to/from the associated View component. virtual void Focus() = 0; diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc index e90e096..b091890ef 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -38,9 +38,9 @@ #include "chrome/common/native_web_keyboard_event.h" #include "gfx/gtk_preserve_window.h" #include "third_party/WebKit/WebKit/chromium/public/gtk/WebInputEventFactory.h" -#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/webaccessibility.h" #include "webkit/glue/webcursor_gtk_data.h" +#include "webkit/plugins/npapi/webplugin.h" #if defined(OS_CHROMEOS) #include "views/widget/tooltip_window_gtk.h" @@ -587,7 +587,7 @@ gfx::NativeView RenderWidgetHostViewGtk::GetNativeView() { } void RenderWidgetHostViewGtk::MovePluginWindows( - const std::vector<webkit_glue::WebPluginGeometry>& moves) { + const std::vector<webkit::npapi::WebPluginGeometry>& moves) { for (size_t i = 0; i < moves.size(); ++i) { plugin_container_manager_.MovePluginContainer(moves[i]); } diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.h b/chrome/browser/renderer_host/render_widget_host_view_gtk.h index 9f9b2e2..2c47c01 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.h +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.h @@ -19,8 +19,8 @@ #include "chrome/browser/renderer_host/render_widget_host_view.h" #include "gfx/native_widget_types.h" #include "gfx/rect.h" -#include "webkit/glue/plugins/gtk_plugin_container_manager.h" #include "webkit/glue/webcursor.h" +#include "webkit/plugins/npapi/gtk_plugin_container_manager.h" class RenderWidgetHost; class GtkIMContextWrapper; @@ -61,7 +61,7 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView, virtual void SetSize(const gfx::Size& size); virtual gfx::NativeView GetNativeView(); virtual void MovePluginWindows( - const std::vector<webkit_glue::WebPluginGeometry>& moves); + const std::vector<webkit::npapi::WebPluginGeometry>& moves); virtual void Focus(); virtual void Blur(); virtual bool HasFocus(); @@ -208,7 +208,7 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView, scoped_ptr<GtkKeyBindingsHandler> key_bindings_handler_; // Helper class that lets us allocate plugin containers and move them. - GtkPluginContainerManager plugin_container_manager_; + webkit::npapi::GtkPluginContainerManager plugin_container_manager_; // The size that we want the renderer to be. We keep this in a separate // variable because resizing in GTK+ is async. diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.h b/chrome/browser/renderer_host/render_widget_host_view_mac.h index 46efeee..d538758 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.h +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.h @@ -184,7 +184,7 @@ class RenderWidgetHostViewMac : public RenderWidgetHostView { virtual void SetSize(const gfx::Size& size); virtual gfx::NativeView GetNativeView(); virtual void MovePluginWindows( - const std::vector<webkit_glue::WebPluginGeometry>& moves); + const std::vector<webkit::npapi::WebPluginGeometry>& moves); virtual void Focus(); virtual void Blur(); virtual bool HasFocus(); diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm index 22175dc..60cc85e 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -40,8 +40,8 @@ #include "third_party/skia/include/core/SkColor.h" #include "third_party/WebKit/WebKit/chromium/public/mac/WebInputEventFactory.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" -#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/webaccessibility.h" +#include "webkit/plugins/npapi/webplugin.h" #import "third_party/mozilla/ComplexTextInputPanel.h" using WebKit::WebInputEvent; @@ -623,15 +623,15 @@ gfx::NativeView RenderWidgetHostViewMac::GetNativeView() { } void RenderWidgetHostViewMac::MovePluginWindows( - const std::vector<webkit_glue::WebPluginGeometry>& moves) { + const std::vector<webkit::npapi::WebPluginGeometry>& moves) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Handle movement of accelerated plugins, which are the only "windowed" // plugins that exist on the Mac. - for (std::vector<webkit_glue::WebPluginGeometry>::const_iterator iter = + for (std::vector<webkit::npapi::WebPluginGeometry>::const_iterator iter = moves.begin(); iter != moves.end(); ++iter) { - webkit_glue::WebPluginGeometry geom = *iter; + webkit::npapi::WebPluginGeometry geom = *iter; AcceleratedPluginView* view = ViewForPluginWindowHandle(geom.window); DCHECK(view); @@ -978,14 +978,14 @@ void RenderWidgetHostViewMac::AcceleratedSurfaceSetIOSurface( // Fake up a WebPluginGeometry for the root window to set the // container's size; we will never get a notification from the // browser about the root window, only plugins. - webkit_glue::WebPluginGeometry geom; + webkit::npapi::WebPluginGeometry geom; gfx::Rect rect(0, 0, width, height); geom.window = window; geom.window_rect = rect; geom.clip_rect = rect; geom.visible = true; geom.rects_valid = true; - MovePluginWindows(std::vector<webkit_glue::WebPluginGeometry>(1, geom)); + MovePluginWindows(std::vector<webkit::npapi::WebPluginGeometry>(1, geom)); } } diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/chrome/browser/renderer_host/render_widget_host_view_mac_unittest.mm index 521e48d..a36c88f 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac_unittest.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac_unittest.mm @@ -57,7 +57,7 @@ class RenderWidgetHostViewMacTest : public RenderViewHostTestHarness { // The accelerated view isn't shown until it has a valid rect and has been // painted to. rwhv_mac_->AcceleratedSurfaceBuffersSwapped(accelerated_handle, 0, 0, 0, 0); - webkit_glue::WebPluginGeometry geom; + webkit::npapi::WebPluginGeometry geom; gfx::Rect rect(0, 0, w, h); geom.window = accelerated_handle; geom.window_rect = rect; @@ -65,7 +65,7 @@ class RenderWidgetHostViewMacTest : public RenderViewHostTestHarness { geom.visible = true; geom.rects_valid = true; rwhv_mac_->MovePluginWindows( - std::vector<webkit_glue::WebPluginGeometry>(1, geom)); + std::vector<webkit::npapi::WebPluginGeometry>(1, geom)); return accelerated_handle; } diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc index cb17689..c48a1a9 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc @@ -193,7 +193,7 @@ void RenderWidgetHostViewViews::SetSize(const gfx::Size& size) { } void RenderWidgetHostViewViews::MovePluginWindows( - const std::vector<webkit_glue::WebPluginGeometry>& moves) { + const std::vector<webkit::npapi::WebPluginGeometry>& moves) { // TODO(anicolao): NIY // NOTIMPLEMENTED(); } diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.h b/chrome/browser/renderer_host/render_widget_host_view_views.h index 9c5c8cb..8a582a7 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views.h +++ b/chrome/browser/renderer_host/render_widget_host_view_views.h @@ -44,7 +44,7 @@ class RenderWidgetHostViewViews : public RenderWidgetHostView, virtual void WasHidden(); virtual void SetSize(const gfx::Size& size); virtual void MovePluginWindows( - const std::vector<webkit_glue::WebPluginGeometry>& moves); + const std::vector<webkit::npapi::WebPluginGeometry>& moves); virtual void Focus(); virtual void Blur(); virtual bool HasFocus(); diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index f5afe70..6a86bc0 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -46,11 +46,11 @@ #include "views/focus/focus_util_win.h" // Included for views::kReflectedMessage - TODO(beng): move this to win_util.h! #include "views/widget/widget_win.h" -#include "webkit/glue/plugins/plugin_constants_win.h" -#include "webkit/glue/plugins/webplugin_delegate_impl.h" -#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/webaccessibility.h" #include "webkit/glue/webcursor.h" +#include "webkit/plugins/npapi/plugin_constants_win.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/webplugin.h" using app::ViewProp; using base::TimeDelta; @@ -59,7 +59,7 @@ using WebKit::WebInputEvent; using WebKit::WebInputEventFactory; using WebKit::WebMouseEvent; using WebKit::WebTextDirection; -using webkit_glue::WebPluginGeometry; +using webkit::npapi::WebPluginGeometry; const wchar_t kRenderWidgetHostHWNDClass[] = L"Chrome_RenderWidgetHostHWND"; @@ -236,7 +236,7 @@ class NotifyPluginProcessHostTask : public Task { // Windows callback for OnDestroy to detach the plugin windows. BOOL CALLBACK DetachPluginWindowsCallback(HWND window, LPARAM param) { - if (WebPluginDelegateImpl::IsPluginDelegateWindow(window) && + if (webkit::npapi::WebPluginDelegateImpl::IsPluginDelegateWindow(window) && !IsHungAppWindow(window)) { ::ShowWindow(window, SW_HIDE); SetParent(window, NULL); @@ -490,7 +490,7 @@ HWND RenderWidgetHostViewWin::ReparentWindow(HWND window) { wcex.hCursor = 0; wcex.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW+1); wcex.lpszMenuName = 0; - wcex.lpszClassName = kWrapperNativeWindowClassName; + wcex.lpszClassName = webkit::npapi::kWrapperNativeWindowClassName; wcex.hIconSm = 0; window_class = RegisterClassEx(&wcex); } @@ -654,11 +654,11 @@ void RenderWidgetHostViewWin::ImeCancelComposition() { } BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lparam) { - if (!WebPluginDelegateImpl::IsPluginDelegateWindow(hwnd)) + if (!webkit::npapi::WebPluginDelegateImpl::IsPluginDelegateWindow(hwnd)) return TRUE; gfx::Rect* rect = reinterpret_cast<gfx::Rect*>(lparam); - static UINT msg = RegisterWindowMessage(kPaintMessageName); + static UINT msg = RegisterWindowMessage(webkit::npapi::kPaintMessageName); WPARAM wparam = rect->x() << 16 | rect->y(); lparam = rect->width() << 16 | rect->height(); @@ -1447,7 +1447,8 @@ LRESULT RenderWidgetHostViewWin::OnMouseActivate(UINT message, ::ScreenToClient(m_hWnd, &cursor_pos); HWND child_window = ::RealChildWindowFromPoint(m_hWnd, cursor_pos); if (::IsWindow(child_window) && child_window != m_hWnd) { - if (win_util::GetClassName(child_window) == kWrapperNativeWindowClassName) + if (win_util::GetClassName(child_window) == + webkit::npapi::kWrapperNativeWindowClassName) child_window = ::GetWindow(child_window, GW_CHILD); ::SetFocus(child_window); diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.h b/chrome/browser/renderer_host/render_widget_host_view_win.h index 1f67814..50e59a6 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.h +++ b/chrome/browser/renderer_host/render_widget_host_view_win.h @@ -132,7 +132,7 @@ class RenderWidgetHostViewWin virtual void SetSize(const gfx::Size& size); virtual gfx::NativeView GetNativeView(); virtual void MovePluginWindows( - const std::vector<webkit_glue::WebPluginGeometry>& moves); + const std::vector<webkit::npapi::WebPluginGeometry>& moves); virtual void Focus(); virtual void Blur(); virtual bool HasFocus(); diff --git a/chrome/browser/renderer_host/test/test_render_view_host.h b/chrome/browser/renderer_host/test/test_render_view_host.h index 7aa9638..f84bc21 100644 --- a/chrome/browser/renderer_host/test/test_render_view_host.h +++ b/chrome/browser/renderer_host/test/test_render_view_host.h @@ -60,7 +60,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostView { virtual void SetSize(const gfx::Size& size) {} virtual gfx::NativeView GetNativeView() { return NULL; } virtual void MovePluginWindows( - const std::vector<webkit_glue::WebPluginGeometry>& moves) {} + const std::vector<webkit::npapi::WebPluginGeometry>& moves) {} #if defined(OS_WIN) virtual void ForwardMouseEventToRenderer(UINT message, WPARAM wparam, diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 46498e3..8f5ed48 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -113,7 +113,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/password_form.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" // Cross-Site Navigations // @@ -2091,8 +2091,8 @@ void TabContents::OnCrashedPlugin(const FilePath& plugin_path) { DCHECK(!plugin_path.value().empty()); std::wstring plugin_name = plugin_path.ToWStringHack(); - WebPluginInfo plugin_info; - if (NPAPI::PluginList::Singleton()->GetPluginInfoByPath( + webkit::npapi::WebPluginInfo plugin_info; + if (webkit::npapi::PluginList::Singleton()->GetPluginInfoByPath( plugin_path, &plugin_info) && !plugin_info.name.empty()) { plugin_name = UTF16ToWide(plugin_info.name); diff --git a/chrome/browser/ui/cocoa/table_model_array_controller_unittest.mm b/chrome/browser/ui/cocoa/table_model_array_controller_unittest.mm index 051d58b..746d8a1 100644 --- a/chrome/browser/ui/cocoa/table_model_array_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/table_model_array_controller_unittest.mm @@ -15,8 +15,8 @@ #include "grit/generated_resources.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest_mac.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" class TableModelArrayControllerTest : public CocoaTest { public: @@ -50,27 +50,27 @@ class TableModelArrayControllerTest : public CocoaTest { model_.reset(new MockPluginExceptionsTableModel(map, NULL)); - std::vector<PluginGroup> plugins; - WebPluginInfo foo_plugin; + std::vector<webkit::npapi::PluginGroup> plugins; + webkit::npapi::WebPluginInfo foo_plugin; foo_plugin.path = FilePath(FILE_PATH_LITERAL("a-foo")); foo_plugin.name = ASCIIToUTF16("FooPlugin"); foo_plugin.enabled = true; - scoped_ptr<PluginGroup> foo_group( - PluginGroup::FromWebPluginInfo(foo_plugin)); + scoped_ptr<webkit::npapi::PluginGroup> foo_group( + webkit::npapi::PluginGroup::FromWebPluginInfo(foo_plugin)); plugins.push_back(*foo_group); - WebPluginInfo bar_plugin; + webkit::npapi::WebPluginInfo bar_plugin; bar_plugin.path = FilePath(FILE_PATH_LITERAL("b-bar")); bar_plugin.name = ASCIIToUTF16("BarPlugin"); bar_plugin.enabled = true; - scoped_ptr<PluginGroup> bar_group( - PluginGroup::FromWebPluginInfo(bar_plugin)); + scoped_ptr<webkit::npapi::PluginGroup> bar_group( + webkit::npapi::PluginGroup::FromWebPluginInfo(bar_plugin)); plugins.push_back(*bar_group); - WebPluginInfo blurp_plugin; + webkit::npapi::WebPluginInfo blurp_plugin; blurp_plugin.path = FilePath(FILE_PATH_LITERAL("c-blurp")); blurp_plugin.name = ASCIIToUTF16("BlurpPlugin"); blurp_plugin.enabled = true; - scoped_ptr<PluginGroup> blurp_group( - PluginGroup::FromWebPluginInfo(blurp_plugin)); + scoped_ptr<webkit::npapi::PluginGroup> blurp_group( + webkit::npapi::PluginGroup::FromWebPluginInfo(blurp_plugin)); plugins.push_back(*blurp_group); model_->set_plugins(plugins); diff --git a/chrome/common/chrome_plugin_lib.cc b/chrome/common/chrome_plugin_lib.cc index 3277f4a..1bd118b 100644 --- a/chrome/common/chrome_plugin_lib.cc +++ b/chrome/common/chrome_plugin_lib.cc @@ -19,7 +19,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/notification_service.h" #include "chrome/common/chrome_paths.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" using base::TimeDelta; @@ -114,7 +114,7 @@ void ChromePluginLib::RegisterPluginsWithNPAPI() { FilePath path; // Register Gears, if available. if (PathService::Get(chrome::FILE_GEARS_PLUGIN, &path)) - NPAPI::PluginList::Singleton()->AddExtraPluginPath(path); + webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); } static void LogPluginLoadTime(const TimeDelta &time) { diff --git a/chrome/common/default_plugin.cc b/chrome/common/default_plugin.cc index bba738b..3337c7c 100644 --- a/chrome/common/default_plugin.cc +++ b/chrome/common/default_plugin.cc @@ -5,13 +5,13 @@ #include "chrome/common/default_plugin.h" #include "chrome/default_plugin/plugin_main.h" -#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/plugin_list.h" namespace chrome { void RegisterInternalDefaultPlugin() { - const NPAPI::PluginVersionInfo default_plugin = { - FilePath(kDefaultPluginLibraryName), + const webkit::npapi::PluginVersionInfo default_plugin = { + FilePath(webkit::npapi::kDefaultPluginLibraryName), L"Default Plug-in", L"Provides functionality for installing third-party plug-ins", L"1", @@ -27,7 +27,8 @@ void RegisterInternalDefaultPlugin() { } }; - NPAPI::PluginList::Singleton()->RegisterInternalPlugin(default_plugin); + webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin( + default_plugin); } } // namespace chrome diff --git a/chrome/common/gpu_plugin.cc b/chrome/common/gpu_plugin.cc index 84ab339..4600638 100644 --- a/chrome/common/gpu_plugin.cc +++ b/chrome/common/gpu_plugin.cc @@ -9,18 +9,15 @@ #include "base/utf_string_conversions.h" #include "chrome/common/chrome_switches.h" #include "gpu/gpu_plugin/gpu_plugin.h" -#include "webkit/glue/plugins/plugin_list.h" - -#if defined(ENABLE_GPU) -#include "webkit/glue/plugins/plugin_constants_win.h" -#endif +#include "webkit/plugins/npapi/plugin_list.h" namespace chrome { void RegisterInternalGPUPlugin() { #if defined(ENABLE_GPU) - static const std::wstring kWideMimeType = ASCIIToWide(kGPUPluginMimeType); - static const NPAPI::PluginVersionInfo kGPUPluginInfo = { + static const std::wstring kWideMimeType = ASCIIToWide( + "application/vnd.google.chrome.gpu-plugin"); + static const webkit::npapi::PluginVersionInfo kGPUPluginInfo = { FilePath(FILE_PATH_LITERAL("gpu-plugin")), L"GPU Plug-in", L"GPU Rendering Plug-in", @@ -38,7 +35,8 @@ void RegisterInternalGPUPlugin() { }; if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableGPUPlugin)) - NPAPI::PluginList::Singleton()->RegisterInternalPlugin(kGPUPluginInfo); + webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin( + kGPUPluginInfo); #endif // ENABLE_GPU } diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc index d0f8d4a..c865a68 100644 --- a/chrome/common/render_messages.cc +++ b/chrome/common/render_messages.cc @@ -23,12 +23,12 @@ #include "webkit/blob/blob_data.h" #include "webkit/glue/form_field.h" #include "webkit/glue/password_form.h" -#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/resource_loader_bridge.h" #include "webkit/glue/webaccessibility.h" #include "webkit/glue/webcookie.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webmenuitem.h" +#include "webkit/plugins/npapi/webplugin.h" #if defined(OS_MACOSX) #include "chrome/common/font_descriptor_mac.h" @@ -196,8 +196,8 @@ void ParamTraits<ContextMenuParams>::Log(const param_type& p, l->append("<ContextMenuParams>"); } -void ParamTraits<webkit_glue::WebPluginGeometry>::Write(Message* m, - const param_type& p) { +void ParamTraits<webkit::npapi::WebPluginGeometry>::Write(Message* m, + const param_type& p) { WriteParam(m, p.window); WriteParam(m, p.window_rect); WriteParam(m, p.clip_rect); @@ -206,7 +206,7 @@ void ParamTraits<webkit_glue::WebPluginGeometry>::Write(Message* m, WriteParam(m, p.visible); } -bool ParamTraits<webkit_glue::WebPluginGeometry>::Read( +bool ParamTraits<webkit::npapi::WebPluginGeometry>::Read( const Message* m, void** iter, param_type* p) { return ReadParam(m, iter, &p->window) && @@ -217,8 +217,8 @@ bool ParamTraits<webkit_glue::WebPluginGeometry>::Read( ReadParam(m, iter, &p->visible); } -void ParamTraits<webkit_glue::WebPluginGeometry>::Log(const param_type& p, - std::string* l) { +void ParamTraits<webkit::npapi::WebPluginGeometry>::Log(const param_type& p, + std::string* l) { l->append("("); LogParam(p.window, l); l->append(", "); @@ -234,21 +234,24 @@ void ParamTraits<webkit_glue::WebPluginGeometry>::Log(const param_type& p, l->append(")"); } -void ParamTraits<WebPluginMimeType>::Write(Message* m, const param_type& p) { +void ParamTraits<webkit::npapi::WebPluginMimeType>::Write(Message* m, + const param_type& p) { WriteParam(m, p.mime_type); WriteParam(m, p.file_extensions); WriteParam(m, p.description); } -bool ParamTraits<WebPluginMimeType>::Read(const Message* m, void** iter, - param_type* r) { +bool ParamTraits<webkit::npapi::WebPluginMimeType>::Read(const Message* m, + void** iter, + param_type* r) { return ReadParam(m, iter, &r->mime_type) && ReadParam(m, iter, &r->file_extensions) && ReadParam(m, iter, &r->description); } -void ParamTraits<WebPluginMimeType>::Log(const param_type& p, std::string* l) { +void ParamTraits<webkit::npapi::WebPluginMimeType>::Log(const param_type& p, + std::string* l) { l->append("("); LogParam(p.mime_type, l); l->append(", "); @@ -258,7 +261,8 @@ void ParamTraits<WebPluginMimeType>::Log(const param_type& p, std::string* l) { l->append(")"); } -void ParamTraits<WebPluginInfo>::Write(Message* m, const param_type& p) { +void ParamTraits<webkit::npapi::WebPluginInfo>::Write(Message* m, + const param_type& p) { WriteParam(m, p.name); WriteParam(m, p.path); WriteParam(m, p.version); @@ -267,8 +271,9 @@ void ParamTraits<WebPluginInfo>::Write(Message* m, const param_type& p) { WriteParam(m, p.enabled); } -bool ParamTraits<WebPluginInfo>::Read(const Message* m, void** iter, - param_type* r) { +bool ParamTraits<webkit::npapi::WebPluginInfo>::Read(const Message* m, + void** iter, + param_type* r) { return ReadParam(m, iter, &r->name) && ReadParam(m, iter, &r->path) && @@ -278,7 +283,8 @@ bool ParamTraits<WebPluginInfo>::Read(const Message* m, void** iter, ReadParam(m, iter, &r->enabled); } -void ParamTraits<WebPluginInfo>::Log(const param_type& p, std::string* l) { +void ParamTraits<webkit::npapi::WebPluginInfo>::Log(const param_type& p, + std::string* l) { l->append("("); LogParam(p.name, l); l->append(", "); diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 6e4e6b9..06e597c 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -61,10 +61,17 @@ struct ResourceLoadTimingInfo; struct ResourceResponseInfo; struct WebAccessibility; struct WebCookie; -struct WebPluginGeometry; struct WebAccessibility; } +namespace webkit { +namespace npapi { +struct WebPluginGeometry; +struct WebPluginInfo; +struct WebPluginMimeType; +} +} + struct AudioBuffersState; class ExtensionExtent; class GURL; @@ -77,8 +84,6 @@ struct SyncLoadResult; struct RendererPreferences; struct WebDropData; struct WebMenuItem; -struct WebPluginInfo; -struct WebPluginMimeType; struct WebPreferences; // Forward declarations of structures used to store data for when we have a lot @@ -151,8 +156,8 @@ struct ParamTraits<ContextMenuParams> { }; template <> -struct ParamTraits<webkit_glue::WebPluginGeometry> { - typedef webkit_glue::WebPluginGeometry param_type; +struct ParamTraits<webkit::npapi::WebPluginGeometry> { + typedef webkit::npapi::WebPluginGeometry param_type; static void Write(Message* m, const param_type& p); static bool Read(const Message* m, void** iter, param_type* p); static void Log(const param_type& p, std::string* l); @@ -160,16 +165,16 @@ struct ParamTraits<webkit_glue::WebPluginGeometry> { // Traits for ViewMsg_GetPlugins_Reply structure to pack/unpack. template <> -struct ParamTraits<WebPluginMimeType> { - typedef WebPluginMimeType param_type; +struct ParamTraits<webkit::npapi::WebPluginMimeType> { + typedef webkit::npapi::WebPluginMimeType param_type; static void Write(Message* m, const param_type& p); static bool Read(const Message* m, void** iter, param_type* r); static void Log(const param_type& p, std::string* l); }; template <> -struct ParamTraits<WebPluginInfo> { - typedef WebPluginInfo param_type; +struct ParamTraits<webkit::npapi::WebPluginInfo> { + typedef webkit::npapi::WebPluginInfo param_type; static void Write(Message* m, const param_type& p); static bool Read(const Message* m, void** iter, param_type* r); static void Log(const param_type& p, std::string* l); diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 947be93..01fc555 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -30,8 +30,8 @@ #include "webkit/glue/context_menu.h" #include "webkit/glue/form_data.h" #include "webkit/glue/password_form_dom_manager.h" -#include "webkit/glue/plugins/webplugininfo.h" #include "webkit/glue/webdropdata.h" +#include "webkit/plugins/npapi/webplugininfo.h" #if defined(OS_POSIX) #include "base/file_descriptor_posix.h" @@ -1362,8 +1362,8 @@ IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_CookiesEnabled, // Used to get the list of plugins IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetPlugins, - bool /* refresh*/, - std::vector<WebPluginInfo> /* plugins */) + bool /* refresh*/, + std::vector<webkit::npapi::WebPluginInfo> /* plugins */) // Return information about a plugin for the given URL and MIME // type. If there is no matching plugin, |found| is false. If @@ -1391,7 +1391,7 @@ IPC_SYNC_MESSAGE_CONTROL3_4(ViewHostMsg_GetPluginInfo, GURL /* policy_url */, std::string /* mime_type */, bool /* found */, - WebPluginInfo /* plugin info */, + webkit::npapi::WebPluginInfo /* plugin info */, ContentSetting /* setting */, std::string /* actual_mime_type */) @@ -1535,7 +1535,7 @@ IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_OpenChannelToPlugin, GURL /* url */, std::string /* mime_type */, IPC::ChannelHandle /* channel_handle */, - WebPluginInfo /* info */) + webkit::npapi::WebPluginInfo /* info */) // A renderer sends this to the browser process when it wants to // create a pepper plugin. The browser will create the plugin process if diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h index 7b21a20..911e3ae 100644 --- a/chrome/common/render_messages_params.h +++ b/chrome/common/render_messages_params.h @@ -32,11 +32,11 @@ #include "media/audio/audio_parameters.h" #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" #include "webkit/glue/password_form.h" -#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/resource_type.h" #include "webkit/glue/webaccessibility.h" #include "webkit/glue/webmenuitem.h" #include "webkit/glue/webpreferences.h" +#include "webkit/plugins/npapi/webplugin.h" // TODO(erg): Split this file into $1_db_params.h, $1_audio_params.h, // $1_print_params.h and $1_render_params.h. @@ -356,7 +356,7 @@ struct ViewHostMsg_UpdateRect_Params { gfx::Rect resizer_rect; // New window locations for plugin child windows. - std::vector<webkit_glue::WebPluginGeometry> plugin_window_moves; + std::vector<webkit::npapi::WebPluginGeometry> plugin_window_moves; // The following describes the various bits that may be set in flags: // diff --git a/chrome/default_plugin/DEPS b/chrome/default_plugin/DEPS index 6e518f99..0ba7c46 100644 --- a/chrome/default_plugin/DEPS +++ b/chrome/default_plugin/DEPS @@ -3,4 +3,5 @@ include_rules = [ "+grit", # For generated headers "+libxml", "+webkit/glue", + "+webkit/plugins", ] diff --git a/chrome/default_plugin/plugin_impl_gtk.cc b/chrome/default_plugin/plugin_impl_gtk.cc index ae7dfb2..b6dc38a 100644 --- a/chrome/default_plugin/plugin_impl_gtk.cc +++ b/chrome/default_plugin/plugin_impl_gtk.cc @@ -14,7 +14,7 @@ #include "grit/webkit_strings.h" #include "unicode/locid.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/plugins/default_plugin_shared.h" +#include "webkit/plugins/npapi/default_plugin_shared.h" // TODO(thakis): Most methods in this class are stubbed out an need to be // implemented. @@ -137,6 +137,6 @@ void PluginInstallerImpl::NotifyPluginStatus(int status) { default_plugin::g_browser->getvalue( instance_, static_cast<NPNVariable>( - default_plugin::kMissingPluginStatusStart + status), + webkit::npapi::default_plugin::kMissingPluginStatusStart + status), NULL); } diff --git a/chrome/default_plugin/plugin_impl_mac.mm b/chrome/default_plugin/plugin_impl_mac.mm index 0bad41b..f964023 100644 --- a/chrome/default_plugin/plugin_impl_mac.mm +++ b/chrome/default_plugin/plugin_impl_mac.mm @@ -17,7 +17,7 @@ #include "grit/webkit_strings.h" #include "unicode/locid.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/plugins/default_plugin_shared.h" +#include "webkit/plugins/npapi/default_plugin_shared.h" // TODO(thakis): Most methods in this class are stubbed out and need to be // implemented. @@ -194,6 +194,6 @@ void PluginInstallerImpl::NotifyPluginStatus(int status) { default_plugin::g_browser->getvalue( instance_, static_cast<NPNVariable>( - default_plugin::kMissingPluginStatusStart + status), + webkit::npapi::default_plugin::kMissingPluginStatusStart + status), NULL); } diff --git a/chrome/default_plugin/plugin_impl_win.cc b/chrome/default_plugin/plugin_impl_win.cc index e9346c6..cb767b0 100644 --- a/chrome/default_plugin/plugin_impl_win.cc +++ b/chrome/default_plugin/plugin_impl_win.cc @@ -15,7 +15,7 @@ #include "grit/webkit_strings.h" #include "unicode/locid.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/plugins/default_plugin_shared.h" +#include "webkit/plugins/npapi/default_plugin_shared.h" static const int TOOLTIP_MAX_WIDTH = 500; @@ -250,7 +250,8 @@ void PluginInstallerImpl::URLNotify(const char* url, NPReason reason) { if (plugin_available) { DVLOG(1) << "Plugin available for mime type " << mime_type_; DisplayAvailablePluginStatus(); - NotifyPluginStatus(default_plugin::MISSING_PLUGIN_AVAILABLE); + NotifyPluginStatus( + webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE); } else { DLOG(WARNING) << "No plugin available for mime type " << mime_type_; DisplayStatus(IDS_DEFAULT_PLUGIN_NO_PLUGIN_AVAILABLE_MSG); @@ -260,7 +261,8 @@ void PluginInstallerImpl::URLNotify(const char* url, NPReason reason) { int16 PluginInstallerImpl::NPP_HandleEvent(void* event) { NPEvent* npp_event = static_cast<NPEvent*>(event); - if (npp_event->event == default_plugin::kInstallMissingPluginMessage) { + if (npp_event->event == + webkit::npapi::default_plugin::kInstallMissingPluginMessage) { // We could get this message because InfoBar may not be in sync with our // internal processing. So we need to check the status. if (plugin_installer_state() == PluginListDownloaded) { @@ -527,7 +529,8 @@ LRESULT PluginInstallerImpl::OnLButtonDown(UINT message, WPARAM wparam, return 0; if (plugin_installer_state() == PluginListDownloaded) { ShowInstallDialog(); - NotifyPluginStatus(default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD); + NotifyPluginStatus( + webkit::npapi::default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD); } else if (plugin_installer_state_ == PluginInstallerLaunchSuccess) { DCHECK(default_plugin::g_browser); DCHECK(default_plugin::g_browser->geturl); @@ -642,6 +645,6 @@ void PluginInstallerImpl::NotifyPluginStatus(int status) { default_plugin::g_browser->getvalue( instance_, static_cast<NPNVariable>( - default_plugin::kMissingPluginStatusStart + status), + webkit::npapi::default_plugin::kMissingPluginStatusStart + status), NULL); } diff --git a/chrome/plugin/DEPS b/chrome/plugin/DEPS index 3517180..15434bf 100644 --- a/chrome/plugin/DEPS +++ b/chrome/plugin/DEPS @@ -5,7 +5,7 @@ include_rules = [ "+skia/ext", "+third_party/npapi", "+webkit/glue", - "+webkit/glue/plugins", + "+webkit/plugins", "+grit", # For generated headers ] diff --git a/chrome/plugin/chrome_plugin_host.cc b/chrome/plugin/chrome_plugin_host.cc index 22b3da9..8458e25 100644 --- a/chrome/plugin/chrome_plugin_host.cc +++ b/chrome/plugin/chrome_plugin_host.cc @@ -25,7 +25,7 @@ #include "net/base/upload_data.h" #include "net/http/http_response_headers.h" #include "webkit/appcache/appcache_interfaces.h" -#include "webkit/glue/plugins/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_instance.h" #include "webkit/glue/resource_loader_bridge.h" #include "webkit/glue/resource_type.h" #include "webkit/glue/webkit_glue.h" @@ -415,8 +415,8 @@ CPBrowsingContext STDCALL CPB_GetBrowsingContextFromNPP(NPP npp) { if (!npp) return CPERR_INVALID_PARAMETER; - NPAPI::PluginInstance* instance = - static_cast<NPAPI::PluginInstance *>(npp->ndata); + webkit::npapi::PluginInstance* instance = + static_cast<webkit::npapi::PluginInstance *>(npp->ndata); WebPluginProxy* webplugin = static_cast<WebPluginProxy*>(instance->webplugin()); diff --git a/chrome/plugin/npobject_proxy.cc b/chrome/plugin/npobject_proxy.cc index f245151..0b7ff45 100644 --- a/chrome/plugin/npobject_proxy.cc +++ b/chrome/plugin/npobject_proxy.cc @@ -9,7 +9,7 @@ #include "chrome/plugin/plugin_channel.h" #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/plugins/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_instance.h" using WebKit::WebBindings; @@ -460,8 +460,8 @@ bool NPObjectProxy::NPNEvaluate(NPP npp, bool popups_allowed = false; if (npp) { - NPAPI::PluginInstance* plugin_instance = - reinterpret_cast<NPAPI::PluginInstance*>(npp->ndata); + webkit::npapi::PluginInstance* plugin_instance = + reinterpret_cast<webkit::npapi::PluginInstance*>(npp->ndata); if (plugin_instance) popups_allowed = plugin_instance->popups_allowed(); } diff --git a/chrome/plugin/npobject_stub.cc b/chrome/plugin/npobject_stub.cc index c711756..e0a8436 100644 --- a/chrome/plugin/npobject_stub.cc +++ b/chrome/plugin/npobject_stub.cc @@ -12,7 +12,7 @@ #include "third_party/npapi/bindings/npapi.h" #include "third_party/npapi/bindings/npruntime.h" #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" -#include "webkit/glue/plugins/plugin_constants_win.h" +#include "webkit/plugins/npapi/plugin_constants_win.h" using WebKit::WebBindings; @@ -243,7 +243,7 @@ void NPObjectStub::OnSetProperty(const NPIdentifier_Param& name, PluginThread::current()->plugin_path().BaseName().value()); static NPIdentifier fullscreen = WebBindings::getStringIdentifier("fullScreen"); - if (filename == kNewWMPPlugin && id == fullscreen) { + if (filename == webkit::npapi::kNewWMPPlugin && id == fullscreen) { // Workaround for bug 15985, which is if Flash causes WMP to go // full screen a deadlock can occur when WMP calls SetFocus. NPObjectMsg_SetProperty::WriteReplyParams(reply_msg, true); diff --git a/chrome/plugin/npobject_util.cc b/chrome/plugin/npobject_util.cc index 0c54a33..60324cf 100644 --- a/chrome/plugin/npobject_util.cc +++ b/chrome/plugin/npobject_util.cc @@ -10,7 +10,7 @@ #include "chrome/plugin/plugin_channel_base.h" #include "third_party/npapi/bindings/nphostapi.h" #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" -#include "webkit/glue/plugins/plugin_host.h" +#include "webkit/plugins/npapi/plugin_host.h" #include "webkit/glue/webkit_glue.h" using WebKit::WebBindings; @@ -129,7 +129,7 @@ NPNetscapeFuncs *GetHostFunctions() { void PatchNPNFunctions() { g_plugin_process = true; NPNetscapeFuncs* funcs = GetHostFunctions(); - NPAPI::PluginHost::Singleton()->PatchNPNetscapeFuncs(funcs); + webkit::npapi::PluginHost::Singleton()->PatchNPNetscapeFuncs(funcs); } bool IsPluginProcess() { diff --git a/chrome/plugin/plugin_channel.cc b/chrome/plugin/plugin_channel.cc index b3b12951..bc5e61e 100644 --- a/chrome/plugin/plugin_channel.cc +++ b/chrome/plugin/plugin_channel.cc @@ -16,7 +16,7 @@ #include "chrome/plugin/plugin_thread.h" #include "chrome/plugin/webplugin_delegate_stub.h" #include "chrome/plugin/webplugin_proxy.h" -#include "webkit/glue/plugins/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_instance.h" #if defined(OS_POSIX) #include "base/eintr_wrapper.h" @@ -256,12 +256,12 @@ void PluginChannel::OnClearSiteData(uint64 flags, bool success = false; CommandLine* command_line = CommandLine::ForCurrentProcess(); FilePath path = command_line->GetSwitchValuePath(switches::kPluginPath); - scoped_refptr<NPAPI::PluginLib> plugin_lib( - NPAPI::PluginLib::CreatePluginLib(path)); + scoped_refptr<webkit::npapi::PluginLib> plugin_lib( + webkit::npapi::PluginLib::CreatePluginLib(path)); if (plugin_lib.get()) { NPError err = plugin_lib->NP_Initialize(); if (err == NPERR_NO_ERROR) { - scoped_refptr<NPAPI::PluginInstance> instance( + scoped_refptr<webkit::npapi::PluginInstance> instance( plugin_lib->CreateInstance(std::string())); const char* domain_str = domain.empty() ? NULL : domain.c_str(); diff --git a/chrome/plugin/plugin_interpose_util_mac.mm b/chrome/plugin/plugin_interpose_util_mac.mm index 45df449..7299d4b 100644 --- a/chrome/plugin/plugin_interpose_util_mac.mm +++ b/chrome/plugin/plugin_interpose_util_mac.mm @@ -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 @@ #include "chrome/common/plugin_messages.h" #include "chrome/plugin/plugin_thread.h" -#include "webkit/glue/plugins/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" namespace mac_plugin_interposing { @@ -32,7 +32,7 @@ void SwitchToPluginProcess() { __attribute__((visibility("default"))) OpaquePluginRef GetActiveDelegate() { - return WebPluginDelegateImpl::GetActiveDelegate(); + return webkit::npapi::WebPluginDelegateImpl::GetActiveDelegate(); } __attribute__((visibility("default"))) @@ -72,13 +72,15 @@ void NotifyBrowserOfPluginHideWindow(uint32 window_id, CGRect bounds) { __attribute__((visibility("default"))) void NotifyPluginOfSetThemeCursor(OpaquePluginRef delegate, ThemeCursor cursor) { - static_cast<WebPluginDelegateImpl*>(delegate)->SetThemeCursor(cursor); + static_cast<webkit::npapi::WebPluginDelegateImpl*>(delegate)->SetThemeCursor( + cursor); } __attribute__((visibility("default"))) void NotifyPluginOfSetCursor(OpaquePluginRef delegate, const Cursor* cursor) { - static_cast<WebPluginDelegateImpl*>(delegate)->SetCursor(cursor); + static_cast<webkit::npapi::WebPluginDelegateImpl*>(delegate)->SetCursor( + cursor); } void NotifyPluginOfSetCursorVisibility(bool visibility) { @@ -91,7 +93,8 @@ void NotifyPluginOfSetCursorVisibility(bool visibility) { __attribute__((visibility("default"))) bool GetPluginWindowHasFocus(const OpaquePluginRef delegate) { - return static_cast<WebPluginDelegateImpl*>(delegate)->GetWindowHasFocus(); + return static_cast<webkit::npapi::WebPluginDelegateImpl*>( + delegate)->GetWindowHasFocus(); } } // namespace mac_plugin_interposing @@ -237,7 +240,8 @@ static void OnPluginWindowShown(const WindowInfo& window_info, BOOL is_modal) { - (void)chromePlugin_set { OpaquePluginRef delegate = mac_plugin_interposing::GetActiveDelegate(); if (delegate) { - static_cast<WebPluginDelegateImpl*>(delegate)->SetNSCursor(self); + static_cast<webkit::npapi::WebPluginDelegateImpl*>(delegate)->SetNSCursor( + self); return; } [self chromePlugin_set]; diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index 7e2b921..8edcbbd 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -29,9 +29,9 @@ #include "chrome/renderer/render_thread.h" #include "ipc/ipc_channel_handle.h" #include "net/base/net_errors.h" -#include "webkit/glue/plugins/plugin_lib.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/plugins/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/plugin_lib.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" #if defined(TOOLKIT_USES_GTK) #include "gfx/gtk_util.h" @@ -86,8 +86,8 @@ PluginThread::PluginThread() ChromePluginLib::Create(plugin_path_, GetCPBrowserFuncsForPlugin()); - scoped_refptr<NPAPI::PluginLib> plugin( - NPAPI::PluginLib::CreatePluginLib(plugin_path_)); + scoped_refptr<webkit::npapi::PluginLib> plugin( + webkit::npapi::PluginLib::CreatePluginLib(plugin_path_)); if (plugin.get()) { plugin->NP_Initialize(); @@ -115,7 +115,7 @@ PluginThread::~PluginThread() { preloaded_plugin_module_ = NULL; } PluginChannelBase::CleanupChannels(); - NPAPI::PluginLib::UnloadAllPlugins(); + webkit::npapi::PluginLib::UnloadAllPlugins(); ChromePluginLib::UnloadAllPlugins(); if (webkit_glue::ShouldForcefullyTerminatePluginProcess()) diff --git a/chrome/plugin/plugin_thread.h b/chrome/plugin/plugin_thread.h index 99d07ed..4d24e3c 100644 --- a/chrome/plugin/plugin_thread.h +++ b/chrome/plugin/plugin_thread.h @@ -11,7 +11,7 @@ #include "build/build_config.h" #include "chrome/common/child_thread.h" #include "chrome/plugin/plugin_channel.h" -#include "webkit/glue/plugins/plugin_lib.h" +#include "webkit/plugins/npapi/plugin_lib.h" #if defined(OS_POSIX) #include "base/file_descriptor_posix.h" diff --git a/chrome/plugin/webplugin_accelerated_surface_proxy_mac.h b/chrome/plugin/webplugin_accelerated_surface_proxy_mac.h index 8764ab9..ee4df63 100644 --- a/chrome/plugin/webplugin_accelerated_surface_proxy_mac.h +++ b/chrome/plugin/webplugin_accelerated_surface_proxy_mac.h @@ -6,7 +6,7 @@ #define CHROME_PLUGIN_WEBPLUGIN_ACCELERATED_SURFACE_PROXY_H_ #pragma once -#include "webkit/glue/plugins/webplugin_accelerated_surface_mac.h" +#include "webkit/plugins/npapi/webplugin_accelerated_surface_mac.h" class WebPluginProxy; class AcceleratedSurface; @@ -14,7 +14,7 @@ class AcceleratedSurface; // Out-of-process implementation of WebPluginAcceleratedSurface that proxies // calls through a WebPluginProxy. class WebPluginAcceleratedSurfaceProxy - : public webkit_glue::WebPluginAcceleratedSurface { + : public webkit::npapi::WebPluginAcceleratedSurface { public: // Creates a new WebPluginAcceleratedSurfaceProxy that uses plugin_proxy // to proxy calls. plugin_proxy must outlive this object. diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc index ff0652d..0540adf 100644 --- a/chrome/plugin/webplugin_delegate_stub.cc +++ b/chrome/plugin/webplugin_delegate_stub.cc @@ -20,7 +20,7 @@ #include "skia/ext/platform_device.h" #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" -#include "webkit/glue/plugins/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" #include "webkit/glue/webcursor.h" #if defined(ENABLE_GPU) @@ -29,13 +29,15 @@ using WebKit::WebBindings; using WebKit::WebCursorInfo; -using webkit_glue::WebPlugin; -using webkit_glue::WebPluginResourceClient; +using webkit::npapi::WebPlugin; +using webkit::npapi::WebPluginResourceClient; class FinishDestructionTask : public Task { public: - FinishDestructionTask(WebPluginDelegateImpl* delegate, WebPlugin* webplugin) - : delegate_(delegate), webplugin_(webplugin) { } + FinishDestructionTask(webkit::npapi::WebPluginDelegateImpl* delegate, + WebPlugin* webplugin) + : delegate_(delegate), webplugin_(webplugin) { + } void Run() { // WebPlugin must outlive WebPluginDelegate. @@ -46,8 +48,8 @@ class FinishDestructionTask : public Task { } private: - WebPluginDelegateImpl* delegate_; - WebPlugin* webplugin_; + webkit::npapi::WebPluginDelegateImpl* delegate_; + webkit::npapi::WebPlugin* webplugin_; }; WebPluginDelegateStub::WebPluginDelegateStub( @@ -185,7 +187,8 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params, webplugin_ = new WebPluginProxy( channel_, instance_id_, page_url_, params.containing_window, params.host_render_view_routing_id); - delegate_ = WebPluginDelegateImpl::Create(path, mime_type_, parent); + delegate_ = webkit::npapi::WebPluginDelegateImpl::Create( + path, mime_type_, parent); if (delegate_) { webplugin_->set_delegate(delegate_); *result = delegate_->Initialize(params.url, diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h index cbd2c97..c310467 100644 --- a/chrome/plugin/webplugin_delegate_stub.h +++ b/chrome/plugin/webplugin_delegate_stub.h @@ -29,7 +29,11 @@ namespace WebKit { class WebInputEvent; } +namespace webkit { +namespace npapi { class WebPluginDelegateImpl; +} +} // Converts the IPC messages from WebPluginDelegateProxy into calls to the // actual WebPluginDelegateImpl object. @@ -111,7 +115,7 @@ class WebPluginDelegateStub : public IPC::Channel::Listener, scoped_refptr<PluginChannel> channel_; - WebPluginDelegateImpl* delegate_; + webkit::npapi::WebPluginDelegateImpl* delegate_; WebPluginProxy* webplugin_; bool in_destructor_; diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index bb77108..498df98 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -34,16 +34,17 @@ #endif #include "skia/ext/platform_device.h" #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" -#include "webkit/glue/plugins/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" #if defined(USE_X11) #include "app/x11_util_internal.h" #endif using WebKit::WebBindings; -using webkit_glue::WebPluginResourceClient; + +using webkit::npapi::WebPluginResourceClient; #if defined(OS_MACOSX) -using webkit_glue::WebPluginAcceleratedSurface; +using webkit::npapi::WebPluginAcceleratedSurface; #endif typedef std::map<CPBrowsingContext, WebPluginProxy*> ContextMap; @@ -323,7 +324,8 @@ void WebPluginProxy::HandleURLRequest(const char* url, // Please refer to https://bugzilla.mozilla.org/show_bug.cgi?id=366082 // for more details on this. if (delegate_->GetQuirks() & - WebPluginDelegateImpl::PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS) { + webkit::npapi::WebPluginDelegateImpl:: + PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS) { GURL request_url(url); if (!request_url.SchemeIs(chrome::kHttpScheme) && !request_url.SchemeIs(chrome::kHttpsScheme) && diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h index 66b396c..2a1f1aee 100644 --- a/chrome/plugin/webplugin_proxy.h +++ b/chrome/plugin/webplugin_proxy.h @@ -24,17 +24,23 @@ #include "chrome/common/chrome_plugin_api.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_message.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/webplugin.h" class PluginChannel; + +namespace webkit { +namespace npapi { class WebPluginDelegateImpl; +} +} + #if defined(OS_MACOSX) class WebPluginAcceleratedSurfaceProxy; #endif // This is an implementation of WebPlugin that proxies all calls to the // renderer. -class WebPluginProxy : public webkit_glue::WebPlugin { +class WebPluginProxy : public webkit::npapi::WebPlugin { public: // Creates a new proxy for WebPlugin, using the given sender to send the // marshalled WebPlugin calls. @@ -45,7 +51,7 @@ class WebPluginProxy : public webkit_glue::WebPlugin { int host_render_view_routing_id); ~WebPluginProxy(); - void set_delegate(WebPluginDelegateImpl* d) { delegate_ = d; } + void set_delegate(webkit::npapi::WebPluginDelegateImpl* d) { delegate_ = d; } // WebPlugin overrides virtual void SetWindow(gfx::PluginWindowHandle window); @@ -93,7 +99,7 @@ class WebPluginProxy : public webkit_glue::WebPlugin { // Returns a WebPluginResourceClient object given its id, or NULL if no // object with that id exists. - webkit_glue::WebPluginResourceClient* GetResourceClient(int id); + webkit::npapi::WebPluginResourceClient* GetResourceClient(int id); // Returns the id of the renderer that contains this plugin. int GetRendererId(); @@ -111,7 +117,7 @@ class WebPluginProxy : public webkit_glue::WebPlugin { // Notification received on a plugin issued resource request creation. void OnResourceCreated(int resource_id, - webkit_glue::WebPluginResourceClient* client); + webkit::npapi::WebPluginResourceClient* client); virtual void HandleURLRequest(const char* url, const char* method, @@ -137,7 +143,7 @@ class WebPluginProxy : public webkit_glue::WebPlugin { virtual void SetDeferResourceLoading(unsigned long resource_id, bool defer); virtual bool IsOffTheRecord(); virtual void ResourceClientDeleted( - webkit_glue::WebPluginResourceClient* resource_client); + webkit::npapi::WebPluginResourceClient* resource_client); gfx::NativeViewId containing_window() { return containing_window_; } #if defined(OS_MACOSX) @@ -145,7 +151,7 @@ class WebPluginProxy : public webkit_glue::WebPlugin { virtual void BindFakePluginWindowHandle(bool opaque); - virtual webkit_glue::WebPluginAcceleratedSurface* GetAcceleratedSurface(); + virtual webkit::npapi::WebPluginAcceleratedSurface* GetAcceleratedSurface(); // Tell the browser (via the renderer) to invalidate because the // accelerated buffers have changed. @@ -189,7 +195,7 @@ class WebPluginProxy : public webkit_glue::WebPlugin { const TransportDIB::Handle& background_buffer, const gfx::Rect& window_rect); - typedef base::hash_map<int, webkit_glue::WebPluginResourceClient*> + typedef base::hash_map<int, webkit::npapi::WebPluginResourceClient*> ResourceClientMap; ResourceClientMap resource_clients_; @@ -198,7 +204,7 @@ class WebPluginProxy : public webkit_glue::WebPlugin { uint32 cp_browsing_context_; NPObject* window_npobject_; NPObject* plugin_element_; - WebPluginDelegateImpl* delegate_; + webkit::npapi::WebPluginDelegateImpl* delegate_; gfx::Rect damaged_rect_; bool waiting_for_paint_; gfx::NativeViewId containing_window_; diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc index e3d2a3a..68af8f8 100644 --- a/chrome/renderer/blocked_plugin.cc +++ b/chrome/renderer/blocked_plugin.cc @@ -22,9 +22,9 @@ #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h" #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" -#include "webkit/glue/plugins/plugin_group.h" -#include "webkit/glue/plugins/webview_plugin.h" #include "webkit/glue/webpreferences.h" +#include "webkit/plugins/npapi/plugin_group.h" +#include "webkit/plugins/npapi/webview_plugin.h" using WebKit::WebContextMenuData; using WebKit::WebFrame; @@ -42,7 +42,7 @@ static const unsigned kMenuActionRemove = 2; BlockedPlugin::BlockedPlugin(RenderView* render_view, WebFrame* frame, - const PluginGroup& info, + const webkit::npapi::PluginGroup& info, const WebPluginParams& params, const WebPreferences& preferences, int template_id, @@ -65,10 +65,10 @@ BlockedPlugin::BlockedPlugin(RenderView* render_view, std::string html_data = jstemplate_builder::GetTemplatesHtml( template_html, &values, "t"); - plugin_ = WebViewPlugin::Create(this, - preferences, - html_data, - GURL(kBlockedPluginDataURL)); + plugin_ = webkit::npapi::WebViewPlugin::Create(this, + preferences, + html_data, + GURL(kBlockedPluginDataURL)); registrar_.Add(this, NotificationType::SHOULD_LOAD_PLUGINS, diff --git a/chrome/renderer/blocked_plugin.h b/chrome/renderer/blocked_plugin.h index 53859bc..7b616bf 100644 --- a/chrome/renderer/blocked_plugin.h +++ b/chrome/renderer/blocked_plugin.h @@ -11,26 +11,32 @@ #include "chrome/renderer/custom_menu_listener.h" #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" #include "webkit/glue/cpp_bound_class.h" -#include "webkit/glue/plugins/webview_plugin.h" +#include "webkit/plugins/npapi/webview_plugin.h" class GURL; -class PluginGroup; class RenderView; + +namespace webkit { +namespace npapi { +class PluginGroup; +} +} + class BlockedPlugin : public CppBoundClass, - public WebViewPlugin::Delegate, + public webkit::npapi::WebViewPlugin::Delegate, public NotificationObserver, public CustomMenuListener { public: BlockedPlugin(RenderView* render_view, WebKit::WebFrame* frame, - const PluginGroup& info, + const webkit::npapi::PluginGroup& info, const WebKit::WebPluginParams& params, const WebPreferences& settings, int template_id, const string16& message); - WebViewPlugin* plugin() { return plugin_; } + webkit::npapi::WebViewPlugin* plugin() { return plugin_; } // WebViewPlugin::Delegate methods: virtual void BindWebFrame(WebKit::WebFrame* frame); @@ -62,7 +68,7 @@ class BlockedPlugin : public CppBoundClass, RenderView* render_view_; WebKit::WebFrame* frame_; WebKit::WebPluginParams plugin_params_; - WebViewPlugin* plugin_; + webkit::npapi::WebViewPlugin* plugin_; // The name of the plugin that was blocked. string16 name_; diff --git a/chrome/renderer/pepper_devices.cc b/chrome/renderer/pepper_devices.cc index aa98711..407d454 100644 --- a/chrome/renderer/pepper_devices.cc +++ b/chrome/renderer/pepper_devices.cc @@ -9,8 +9,8 @@ #include "chrome/renderer/webplugin_delegate_pepper.h" #include "skia/ext/platform_canvas.h" #include "third_party/skia/include/core/SkBitmap.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/webplugin.h" namespace { diff --git a/chrome/renderer/pepper_devices_browsertest.cc b/chrome/renderer/pepper_devices_browsertest.cc index e8e0bbe..963975c 100644 --- a/chrome/renderer/pepper_devices_browsertest.cc +++ b/chrome/renderer/pepper_devices_browsertest.cc @@ -18,9 +18,9 @@ #include "third_party/WebKit/WebKit/chromium/public/WebPlugin.h" #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugin_impl.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugin_impl.h" class PepperDeviceTest; @@ -135,9 +135,9 @@ class PepperDeviceTest : public RenderViewTest { virtual void SetUp(); virtual void TearDown(); - NPAPI::PluginVersionInfo version_info_; + webkit::npapi::PluginVersionInfo version_info_; - scoped_ptr<webkit_glue::WebPluginImpl> plugin_; + scoped_ptr<webkit::npapi::WebPluginImpl> plugin_; WebPluginDelegatePepper* pepper_plugin_; // FIXME(brettw): check lifetime. }; @@ -147,7 +147,7 @@ PepperDeviceTest::PepperDeviceTest() { version_info_.file_description = ASCIIToWide("Pepper device test plugin"); version_info_.file_version = ASCIIToWide("1"); version_info_.mime_types = ASCIIToWide(kTestPluginMimeType); - NPAPI::PluginEntryPoints entry_points = { + webkit::npapi::PluginEntryPoints entry_points = { #if !defined(OS_POSIX) || defined(OS_MACOSX) NP_GetEntryPoints, #endif @@ -163,14 +163,14 @@ PepperDeviceTest::~PepperDeviceTest() { void PepperDeviceTest::SetUp() { RenderViewTest::SetUp(); - NPAPI::PluginList::Singleton()->RegisterInternalPlugin(version_info_); + webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(version_info_); // Create the WebKit plugin with no delegates (this seems to work // sufficiently for the test). WebKit::WebPluginParams params; - plugin_.reset(new webkit_glue::WebPluginImpl( + plugin_.reset(new webkit::npapi::WebPluginImpl( NULL, params, FilePath(), std::string(), - base::WeakPtr<webkit_glue::WebPluginPageDelegate>())); + base::WeakPtr<webkit::npapi::WebPluginPageDelegate>())); // Create a pepper plugin for the RenderView. pepper_plugin_ = WebPluginDelegatePepper::Create( @@ -201,7 +201,8 @@ void PepperDeviceTest::TearDown() { if (pepper_plugin_) pepper_plugin_->PluginDestroyed(); - NPAPI::PluginList::Singleton()->UnregisterInternalPlugin(version_info_.path); + webkit::npapi::PluginList::Singleton()->UnregisterInternalPlugin( + version_info_.path); RenderViewTest::TearDown(); } diff --git a/chrome/renderer/pepper_plugin_delegate_impl.cc b/chrome/renderer/pepper_plugin_delegate_impl.cc index 87aa127..e223202 100644 --- a/chrome/renderer/pepper_plugin_delegate_impl.cc +++ b/chrome/renderer/pepper_plugin_delegate_impl.cc @@ -41,7 +41,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "webkit/fileapi/file_system_callback_dispatcher.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/webplugin.h" #include "webkit/plugins/ppapi/ppb_file_io_impl.h" #include "webkit/plugins/ppapi/plugin_module.h" #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" diff --git a/chrome/renderer/pepper_scrollbar_widget.cc b/chrome/renderer/pepper_scrollbar_widget.cc index 63c446a..c4878a3 100644 --- a/chrome/renderer/pepper_scrollbar_widget.cc +++ b/chrome/renderer/pepper_scrollbar_widget.cc @@ -11,7 +11,7 @@ #include "skia/ext/platform_canvas.h" #include "skia/ext/platform_device.h" #include "third_party/WebKit/WebKit/chromium/public/WebScrollbar.h" -#include "webkit/glue/plugins/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_instance.h" #include "webkit/glue/webkit_glue.h" using WebKit::WebInputEvent; diff --git a/chrome/renderer/pepper_widget.cc b/chrome/renderer/pepper_widget.cc index ba37f87..176510f 100644 --- a/chrome/renderer/pepper_widget.cc +++ b/chrome/renderer/pepper_widget.cc @@ -9,9 +9,9 @@ #include "chrome/renderer/pepper_scrollbar_widget.h" #include "chrome/renderer/webplugin_delegate_pepper.h" #include "skia/ext/platform_canvas.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" #if defined(OS_WIN) #include "base/win/windows_version.h" @@ -57,8 +57,8 @@ NPError NPPaintWidget(NPP instance, if (iter == g_widgets.Get().end()) return NPERR_INVALID_PARAM; - NPAPI::PluginInstance* plugin = - static_cast<NPAPI::PluginInstance*>(instance->ndata); + webkit::npapi::PluginInstance* plugin = + static_cast<webkit::npapi::PluginInstance*>(instance->ndata); WebPluginDelegatePepper* delegate = static_cast<WebPluginDelegatePepper*>(plugin->webplugin()->delegate()); Graphics2DDeviceContext* gdc = delegate->GetGraphicsContext(context); @@ -135,8 +135,8 @@ void PepperWidget::Init(NPP instance, int id) { } void PepperWidget::WidgetPropertyChanged(NPWidgetProperty property) { - NPAPI::PluginInstance* instance = - static_cast<NPAPI::PluginInstance*>(instance_->ndata); + webkit::npapi::PluginInstance* instance = + static_cast<webkit::npapi::PluginInstance*>(instance_->ndata); NPPExtensions* extensions = NULL; instance->NPP_GetValue(NPPVPepperExtensions, &extensions); if (!extensions) diff --git a/chrome/renderer/render_process_impl.cc b/chrome/renderer/render_process_impl.cc index 1396713..495a234 100644 --- a/chrome/renderer/render_process_impl.cc +++ b/chrome/renderer/render_process_impl.cc @@ -35,8 +35,8 @@ #include "native_client/src/shared/imc/nacl_imc.h" #include "native_client/src/trusted/plugin/nacl_entry_points.h" #include "skia/ext/platform_canvas.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/plugin_lib.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_lib.h" #include "webkit/glue/webkit_glue.h" #if defined(OS_MACOSX) diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 2c50d8e..5dd3359 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -172,18 +172,18 @@ #include "webkit/glue/image_resource_fetcher.h" #include "webkit/glue/media/video_renderer_impl.h" #include "webkit/glue/password_form_dom_manager.h" -#include "webkit/glue/plugins/default_plugin_shared.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugin_delegate.h" -#include "webkit/glue/plugins/webplugin_delegate_impl.h" -#include "webkit/glue/plugins/webplugin_impl.h" -#include "webkit/glue/plugins/webview_plugin.h" #include "webkit/glue/resource_fetcher.h" #include "webkit/glue/site_isolation_metrics.h" #include "webkit/glue/webaccessibility.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webmediaplayer_impl.h" +#include "webkit/plugins/npapi/default_plugin_shared.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugin_delegate.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/webplugin_impl.h" +#include "webkit/plugins/npapi/webview_plugin.h" #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" #if defined(OS_WIN) @@ -842,7 +842,7 @@ void RenderView::PluginCrashed(const FilePath& plugin_path) { WebPlugin* RenderView::CreatePluginNoCheck(WebFrame* frame, const WebPluginParams& params) { - WebPluginInfo info; + webkit::npapi::WebPluginInfo info; bool found; ContentSetting setting; std::string mime_type; @@ -2026,14 +2026,15 @@ void RenderView::OnMissingPluginStatus( #if defined(OS_WIN) if (!first_default_plugin_) { // Show the InfoBar for the first available plugin. - if (status == default_plugin::MISSING_PLUGIN_AVAILABLE) { + if (status == webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE) { first_default_plugin_ = delegate->AsWeakPtr(); Send(new ViewHostMsg_MissingPluginStatus(routing_id_, status)); } } else { // Closes the InfoBar if user clicks on the plugin (instead of the InfoBar) // to start the download/install. - if (status == default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD) { + if (status == + webkit::npapi::default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD) { Send(new ViewHostMsg_MissingPluginStatus(routing_id_, status)); } } @@ -2754,7 +2755,7 @@ WebPlugin* RenderView::createPlugin(WebFrame* frame, bool found = false; ContentSetting plugin_setting = CONTENT_SETTING_DEFAULT; CommandLine* cmd = CommandLine::ForCurrentProcess(); - WebPluginInfo info; + webkit::npapi::WebPluginInfo info; GURL url(params.url); std::string actual_mime_type; Send(new ViewHostMsg_GetPluginInfo(url, @@ -2769,8 +2770,8 @@ WebPlugin* RenderView::createPlugin(WebFrame* frame, return NULL; DCHECK(plugin_setting != CONTENT_SETTING_DEFAULT); - const PluginGroup* group = - NPAPI::PluginList::Singleton()->GetPluginGroup(info); + const webkit::npapi::PluginGroup* group = + webkit::npapi::PluginList::Singleton()->GetPluginGroup(info); DCHECK(group != NULL); if (cmd->HasSwitch(switches::kBlockOutdatedPlugins) && @@ -2789,7 +2790,7 @@ WebPlugin* RenderView::createPlugin(WebFrame* frame, ContentSetting host_setting = current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS]; - if (info.path.value() == kDefaultPluginLibraryName || + if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName || plugin_setting == CONTENT_SETTING_ALLOW || host_setting == CONTENT_SETTING_ALLOW) { scoped_refptr<webkit::ppapi::PluginModule> pepper_module( @@ -3939,7 +3940,7 @@ void RenderView::openFileSystem( // webkit_glue::WebPluginPageDelegate ----------------------------------------- -webkit_glue::WebPluginDelegate* RenderView::CreatePluginDelegate( +webkit::npapi::WebPluginDelegate* RenderView::CreatePluginDelegate( const FilePath& file_path, const std::string& mime_type) { if (!PluginChannelHost::IsListening()) @@ -4007,7 +4008,7 @@ webkit_glue::WebPluginDelegate* RenderView::CreatePluginDelegate( return pepper_plugin; } else { #if defined(OS_WIN) // In-proc plugins aren't supported on Linux or Mac. - return WebPluginDelegateImpl::Create( + return webkit::npapi::WebPluginDelegateImpl::Create( file_path, mime_type, gfx::NativeViewFromId(host_window_)); #else NOTIMPLEMENTED(); @@ -4034,7 +4035,7 @@ void RenderView::WillDestroyPluginWindow(gfx::PluginWindowHandle window) { CleanupWindowInPluginMoves(window); } -void RenderView::DidMovePlugin(const webkit_glue::WebPluginGeometry& move) { +void RenderView::DidMovePlugin(const webkit::npapi::WebPluginGeometry& move) { SchedulePluginMove(move); } @@ -4436,18 +4437,19 @@ WebPlugin* RenderView::CreatePepperPlugin( pepper_module, params, pepper_delegate_.AsWeakPtr()); } -WebPlugin* RenderView::CreateNPAPIPlugin(WebFrame* frame, - const WebPluginParams& params, - const FilePath& path, - const std::string& mime_type) { - return new webkit_glue::WebPluginImpl( +WebPlugin* RenderView::CreateNPAPIPlugin( + WebFrame* frame, + const WebPluginParams& params, + const FilePath& path, + const std::string& mime_type) { + return new webkit::npapi::WebPluginImpl( frame, params, path, mime_type, AsWeakPtr()); } WebPlugin* RenderView::CreatePluginPlaceholder( WebFrame* frame, const WebPluginParams& params, - const PluginGroup& group, + const webkit::npapi::PluginGroup& group, int resource_id, int message_id) { // |blocked_plugin| will delete itself when the WebViewPlugin diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index d7589dc..af7b969 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -43,8 +43,8 @@ #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" #include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h" #include "third_party/WebKit/WebKit/chromium/public/WebNavigationType.h" -#include "webkit/glue/plugins/webplugin_page_delegate.h" #include "webkit/glue/webpreferences.h" +#include "webkit/plugins/npapi/webplugin_page_delegate.h" #if defined(OS_WIN) // RenderView is a diamond-shaped hierarchy, with WebWidgetClient at the root. @@ -74,7 +74,6 @@ class NotificationProvider; class PageClickTracker; class PasswordAutocompleteManager; class PepperDeviceTest; -class PluginGroup; class PrintWebViewHelper; class RenderViewVisitor; class SkBitmap; @@ -97,12 +96,16 @@ class Rect; } namespace webkit { -namespace ppapi { +namespace npapi { +class PluginGroup; +} // namespace npapi + +namespace ppapi { class PluginInstance; class FullscreenContainer; - } // namespace ppapi + } // namespace webkit namespace safe_browsing { @@ -171,7 +174,7 @@ class RenderView : public RenderWidget, public WebKit::WebViewClient, public WebKit::WebFrameClient, public WebKit::WebPageSerializerClient, - public webkit_glue::WebPluginPageDelegate, + public webkit::npapi::WebPluginPageDelegate, public base::SupportsWeakPtr<RenderView> { public: // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the @@ -650,12 +653,12 @@ class RenderView : public RenderWidget, // webkit_glue::WebPluginPageDelegate implementation ------------------------- - virtual webkit_glue::WebPluginDelegate* CreatePluginDelegate( + virtual webkit::npapi::WebPluginDelegate* CreatePluginDelegate( const FilePath& file_path, const std::string& mime_type); 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( @@ -1026,7 +1029,7 @@ class RenderView : public RenderWidget, WebKit::WebPlugin* CreatePluginPlaceholder( WebKit::WebFrame* frame, const WebKit::WebPluginParams& params, - const PluginGroup& group, + const webkit::npapi::PluginGroup& group, int resource_id, int message_id); @@ -1339,7 +1342,7 @@ class RenderView : public RenderWidget, // Remember the first uninstalled plugin, so that we can ask the plugin // to install itself when user clicks on the info bar. - base::WeakPtr<webkit_glue::WebPluginDelegate> first_default_plugin_; + base::WeakPtr<webkit::npapi::WebPluginDelegate> first_default_plugin_; PepperPluginDelegateImpl pepper_delegate_; diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 13c194d..041fcd9 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -27,8 +27,8 @@ #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" -#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/webkit_glue.h" +#include "webkit/plugins/npapi/webplugin.h" #if defined(OS_POSIX) #include "ipc/ipc_channel_posix.h" @@ -955,7 +955,7 @@ void RenderWidget::resetInputMethod() { } void RenderWidget::SchedulePluginMove( - const webkit_glue::WebPluginGeometry& move) { + const webkit::npapi::WebPluginGeometry& move) { size_t i = 0; for (; i < plugin_window_moves_.size(); ++i) { if (plugin_window_moves_[i].window == move.window) { diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h index 0fd6634..92826e9 100644 --- a/chrome/renderer/render_widget.h +++ b/chrome/renderer/render_widget.h @@ -46,9 +46,11 @@ class WebWidget; struct WebPopupMenuInfo; } -namespace webkit_glue { +namespace webkit { +namespace npapi { struct WebPluginGeometry; } +} // RenderWidget provides a communication bridge between a WebWidget and // a RenderWidgetHost, the latter of which lives in a different process. @@ -111,7 +113,7 @@ class RenderWidget : public IPC::Channel::Listener, // Called when a plugin is moved. These events are queued up and sent with // the next paint or scroll message to the host. - void SchedulePluginMove(const webkit_glue::WebPluginGeometry& move); + void SchedulePluginMove(const webkit::npapi::WebPluginGeometry& move); // Called when a plugin window has been destroyed, to make sure the currently // pending moves don't try to reference it. @@ -337,7 +339,7 @@ class RenderWidget : public IPC::Channel::Listener, WebKit::WebPopupType popup_type_; // Holds all the needed plugin window moves for a scroll. - typedef std::vector<webkit_glue::WebPluginGeometry> WebPluginGeometryVector; + typedef std::vector<webkit::npapi::WebPluginGeometry> WebPluginGeometryVector; WebPluginGeometryVector plugin_window_moves_; // A custom background for the widget. diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc index 5cae2a9..ae5984b 100644 --- a/chrome/renderer/renderer_glue.cc +++ b/chrome/renderer/renderer_glue.cc @@ -205,7 +205,8 @@ bool ClipboardReadFilenames(Clipboard::Buffer buffer, return result; } -void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { +void GetPlugins(bool refresh, + std::vector<webkit::npapi::WebPluginInfo>* plugins) { if (!RenderThread::current()->plugin_refresh_allowed()) refresh = false; RenderThread::current()->Send(new ViewHostMsg_GetPlugins(refresh, plugins)); diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc index 1d2be20..68a14ad 100644 --- a/chrome/renderer/webplugin_delegate_pepper.cc +++ b/chrome/renderer/webplugin_delegate_pepper.cc @@ -55,26 +55,26 @@ #include "third_party/npapi/bindings/npapi_extensions_private.h" #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.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_host.h" -#include "webkit/glue/plugins/plugin_stream_url.h" #include "webkit/glue/webcursor.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_host.h" +#include "webkit/plugins/npapi/plugin_stream_url.h" #if defined(ENABLE_GPU) -#include "webkit/glue/plugins/plugin_constants_win.h" +#include "webkit/plugins/npapi/plugin_constants_win.h" #endif #if defined(ENABLE_GPU) using gpu::Buffer; #endif -using webkit_glue::WebPlugin; -using webkit_glue::WebPluginDelegate; -using webkit_glue::WebPluginResourceClient; +using webkit::npapi::WebPlugin; +using webkit::npapi::WebPluginDelegate; +using webkit::npapi::WebPluginResourceClient; using WebKit::WebCursorInfo; using WebKit::WebKeyboardEvent; using WebKit::WebInputEvent; @@ -114,8 +114,8 @@ WebPluginDelegatePepper* WebPluginDelegatePepper::Create( const FilePath& filename, const std::string& mime_type, const base::WeakPtr<RenderView>& render_view) { - scoped_refptr<NPAPI::PluginLib> plugin_lib( - NPAPI::PluginLib::CreatePluginLib(filename)); + scoped_refptr<webkit::npapi::PluginLib> plugin_lib( + webkit::npapi::PluginLib::CreatePluginLib(filename)); if (plugin_lib.get() == NULL) return NULL; @@ -123,7 +123,7 @@ WebPluginDelegatePepper* WebPluginDelegatePepper::Create( if (err != NPERR_NO_ERROR) return NULL; - scoped_refptr<NPAPI::PluginInstance> instance( + scoped_refptr<webkit::npapi::PluginInstance> instance( plugin_lib->CreateInstance(mime_type)); return new WebPluginDelegatePepper(render_view, instance.get()); @@ -544,7 +544,7 @@ string16 WebPluginDelegatePepper::GetSelectedText(bool html) const { return string16(); string16 rv = UTF8ToUTF16(static_cast<char*>(text)); - NPAPI::PluginHost::Singleton()->host_functions()->memfree(text); + webkit::npapi::PluginHost::Singleton()->host_functions()->memfree(text); return rv; } @@ -680,8 +680,8 @@ NPError WebPluginDelegatePepper::Device3DInitializeContext( // Create an instance of the GPU plugin that is responsible for 3D // rendering. - nested_delegate_ = new WebPluginDelegateProxy(kGPUPluginMimeType, - render_view_); + nested_delegate_ = new WebPluginDelegateProxy( + "application/vnd.google.chrome.gpu-plugin", render_view_); // TODO(apatrick): should the GPU plugin be attached to plugin_? if (nested_delegate_->Initialize(GURL(), @@ -1270,7 +1270,8 @@ bool WebPluginDelegatePepper::VectorPrintPage(int page_number, size_in_pixels.height(), true, false, true, true); #endif // defined(OS_WIN) - NPAPI::PluginHost::Singleton()->host_functions()->memfree(pdf_output); + webkit::npapi::PluginHost::Singleton()->host_functions()->memfree( + pdf_output); return ret; } @@ -1378,7 +1379,7 @@ void WebPluginDelegatePepper::PrintEnd() { WebPluginDelegatePepper::WebPluginDelegatePepper( const base::WeakPtr<RenderView>& render_view, - NPAPI::PluginInstance *instance) + webkit::npapi::PluginInstance *instance) : render_view_(render_view), plugin_(NULL), instance_(instance), @@ -1636,7 +1637,7 @@ void WebPluginDelegatePepper::SendNestedDelegateGeometryToBrowser( return; } - webkit_glue::WebPluginGeometry geom; + webkit::npapi::WebPluginGeometry geom; geom.window = nested_delegate_->GetPluginWindowHandle(); geom.window_rect = window_rect; geom.clip_rect = clip_rect; diff --git a/chrome/renderer/webplugin_delegate_pepper.h b/chrome/renderer/webplugin_delegate_pepper.h index cfe34a1..6285424 100644 --- a/chrome/renderer/webplugin_delegate_pepper.h +++ b/chrome/renderer/webplugin_delegate_pepper.h @@ -22,19 +22,21 @@ #include "third_party/npapi/bindings/npapi.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/WebKit/chromium/public/WebFileChooserCompletion.h" -#include "webkit/glue/plugins/webplugin_delegate.h" +#include "webkit/plugins/npapi/webplugin_delegate.h" class FilePath; class RenderView; class WebCursor; class WebPluginDelegateProxy; -namespace NPAPI { +namespace webkit { +namespace npapi { class PluginInstance; } +} // An implementation of WebPluginDelegate for Pepper in-process plugins. -class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate, +class WebPluginDelegatePepper : public webkit::npapi::WebPluginDelegate, public WebKit::WebFileChooserCompletion { public: static WebPluginDelegatePepper* Create( @@ -42,7 +44,7 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate, const std::string& mime_type, const base::WeakPtr<RenderView>& render_view); - NPAPI::PluginInstance* instance() { return instance_.get(); } + webkit::npapi::PluginInstance* instance() { return instance_.get(); } // WebKit::WebFileChooserCompletion implementation. virtual void didChooseFile( @@ -52,7 +54,7 @@ class WebPluginDelegatePepper : 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, + webkit::npapi::WebPlugin* plugin, bool load_manually); virtual void PluginDestroyed(); virtual void UpdateGeometry(const gfx::Rect& window_rect, @@ -79,9 +81,9 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate, virtual void DidFinishManualLoading(); virtual void DidManualLoadFail(); virtual void InstallMissingPlugin(); - virtual webkit_glue::WebPluginResourceClient* CreateResourceClient( + virtual webkit::npapi::WebPluginResourceClient* CreateResourceClient( unsigned long resource_id, const GURL& url, int notify_id); - virtual webkit_glue::WebPluginResourceClient* CreateSeekableResourceClient( + virtual webkit::npapi::WebPluginResourceClient* CreateSeekableResourceClient( unsigned long resource_id, int range_request_id); virtual bool StartFind(const string16& search_text, bool case_sensitive, @@ -208,7 +210,7 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate, private: WebPluginDelegatePepper( const base::WeakPtr<RenderView>& render_view, - NPAPI::PluginInstance *instance); + webkit::npapi::PluginInstance *instance); ~WebPluginDelegatePepper(); // Set a task that calls the repaint callback the next time the window @@ -275,8 +277,8 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate, base::WeakPtr<RenderView> render_view_; - webkit_glue::WebPlugin* plugin_; - scoped_refptr<NPAPI::PluginInstance> instance_; + webkit::npapi::WebPlugin* plugin_; + scoped_refptr<webkit::npapi::PluginInstance> instance_; NPWindow window_; gfx::Rect window_rect_; diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 5c8d550..1b2e7d7 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -48,7 +48,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/webplugin.h" #include "webkit/glue/webkit_glue.h" #if defined(OS_POSIX) @@ -65,7 +65,7 @@ using WebKit::WebView; // Proxy for WebPluginResourceClient. The object owns itself after creation, // deleting itself after its callback has been called. -class ResourceClientProxy : public webkit_glue::WebPluginResourceClient { +class ResourceClientProxy : public webkit::npapi::WebPluginResourceClient { public: ResourceClientProxy(PluginChannelHost* channel, int instance_id) : channel_(channel), instance_id_(instance_id), resource_id_(0), @@ -267,10 +267,11 @@ static bool SilverlightColorIsTransparent(const std::string& color) { return false; } -bool WebPluginDelegateProxy::Initialize(const GURL& url, +bool WebPluginDelegateProxy::Initialize( + const GURL& url, const std::vector<std::string>& arg_names, const std::vector<std::string>& arg_values, - webkit_glue::WebPlugin* plugin, + webkit::npapi::WebPlugin* plugin, bool load_manually) { IPC::ChannelHandle channel_handle; if (!RenderThread::current()->Send(new ViewHostMsg_OpenChannelToPlugin( @@ -1349,7 +1350,7 @@ void WebPluginDelegateProxy::OnHandleURLRequest( params.popups_allowed, params.notify_redirects); } -webkit_glue::WebPluginResourceClient* +webkit::npapi::WebPluginResourceClient* WebPluginDelegateProxy::CreateResourceClient( unsigned long resource_id, const GURL& url, int notify_id) { if (!channel_host_) @@ -1361,7 +1362,7 @@ WebPluginDelegateProxy::CreateResourceClient( return proxy; } -webkit_glue::WebPluginResourceClient* +webkit::npapi::WebPluginResourceClient* WebPluginDelegateProxy::CreateSeekableResourceClient( unsigned long resource_id, int range_request_id) { if (!channel_host_) @@ -1404,7 +1405,7 @@ bool WebPluginDelegateProxy::BindFakePluginWindowHandle(bool opaque) { // Since this isn't a real window, it doesn't get initial size and location // information the way a real windowed plugin would, so we need to feed it its // starting geometry. - webkit_glue::WebPluginGeometry geom; + webkit::npapi::WebPluginGeometry geom; geom.window = fake_window; geom.window_rect = plugin_rect_; geom.clip_rect = clip_rect_; @@ -1543,7 +1544,7 @@ bool WebPluginDelegateProxy::UseSynchronousGeometryUpdates() { // The move networks plugin needs to be informed of geometry updates // synchronously. - std::vector<WebPluginMimeType>::iterator index; + std::vector<webkit::npapi::WebPluginMimeType>::iterator index; for (index = info_.mime_types.begin(); index != info_.mime_types.end(); index++) { if (index->mime_type == "application/x-vnd.moveplayer.qm" || diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h index 2c20583..30e212e 100644 --- a/chrome/renderer/webplugin_delegate_proxy.h +++ b/chrome/renderer/webplugin_delegate_proxy.h @@ -18,8 +18,8 @@ #include "googleurl/src/gurl.h" #include "ipc/ipc_channel.h" #include "ipc/ipc_message.h" -#include "webkit/glue/plugins/webplugininfo.h" -#include "webkit/glue/plugins/webplugin_delegate.h" +#include "webkit/plugins/npapi/webplugininfo.h" +#include "webkit/plugins/npapi/webplugin_delegate.h" #if defined(OS_MACOSX) #include "base/hash_tables.h" @@ -44,14 +44,16 @@ namespace skia { class PlatformCanvas; } -namespace webkit_glue { +namespace webkit { +namespace npapi { class WebPlugin; } +} // An implementation of WebPluginDelegate that proxies all calls to // the plugin process. class WebPluginDelegateProxy - : public webkit_glue::WebPluginDelegate, + : public webkit::npapi::WebPluginDelegate, public IPC::Channel::Listener, public IPC::Message::Sender, public base::SupportsWeakPtr<WebPluginDelegateProxy> { @@ -64,7 +66,7 @@ class WebPluginDelegateProxy virtual bool Initialize(const GURL& url, const std::vector<std::string>& arg_names, const std::vector<std::string>& arg_values, - webkit_glue::WebPlugin* plugin, + webkit::npapi::WebPlugin* plugin, bool load_manually); virtual void UpdateGeometry(const gfx::Rect& window_rect, const gfx::Rect& clip_rect); @@ -113,9 +115,9 @@ class WebPluginDelegateProxy virtual void DidFinishManualLoading(); virtual void DidManualLoadFail(); virtual void InstallMissingPlugin(); - virtual webkit_glue::WebPluginResourceClient* CreateResourceClient( + virtual webkit::npapi::WebPluginResourceClient* CreateResourceClient( unsigned long resource_id, const GURL& url, int notify_id); - virtual webkit_glue::WebPluginResourceClient* CreateSeekableResourceClient( + virtual webkit::npapi::WebPluginResourceClient* CreateSeekableResourceClient( unsigned long resource_id, int range_request_id); CommandBufferProxy* CreateCommandBuffer(); @@ -231,13 +233,13 @@ class WebPluginDelegateProxy #endif base::WeakPtr<RenderView> render_view_; - webkit_glue::WebPlugin* plugin_; + webkit::npapi::WebPlugin* plugin_; bool uses_shared_bitmaps_; gfx::PluginWindowHandle window_; scoped_refptr<PluginChannelHost> channel_host_; std::string mime_type_; int instance_id_; - WebPluginInfo info_; + webkit::npapi::WebPluginInfo info_; gfx::Rect plugin_rect_; gfx::Rect clip_rect_; diff --git a/chrome/test/plugin/plugin_test.cpp b/chrome/test/plugin/plugin_test.cpp index c68dd99..ed052a0 100644 --- a/chrome/test/plugin/plugin_test.cpp +++ b/chrome/test/plugin/plugin_test.cpp @@ -48,8 +48,9 @@ #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_status.h" #include "third_party/npapi/bindings/npapi.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" +#include "webkit/plugins/plugin_switches.h" #if defined(OS_WIN) #include "base/win/registry.h" @@ -90,7 +91,7 @@ class PluginTest : public UITest { } else if (strcmp(test_info->name(), "MediaPlayerOld") == 0) { // When testing the old WMP plugin, we need to force Chrome to not load // the new plugin. - launch_arguments_.AppendSwitch(kUseOldWMPPluginSwitch); + launch_arguments_.AppendSwitch(switches::kUseOldWMPPlugin); } else if (strcmp(test_info->name(), "FlashSecurity") == 0) { launch_arguments_.AppendSwitchASCII(switches::kTestSandbox, "security_tests.dll"); diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi index 13545b8..14ca0bb 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/common.h', @@ -182,14 +251,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', @@ -265,75 +334,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/plugins/npapi/test/npapi_constants.cc b/webkit/plugins/npapi/test/npapi_constants.cc index 75cc68f..94d3284 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/npapi_constants.h b/webkit/plugins/npapi/test/npapi_constants.h index 6570c35..2d375b0 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/npapi_test.cc b/webkit/plugins/npapi/test/npapi_test.cc index 895a842..26dc45d 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_arguments_test.cc b/webkit/plugins/npapi/test/plugin_arguments_test.cc index 46ccf43..fe1e54e 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_arguments_test.h b/webkit/plugins/npapi/test/plugin_arguments_test.h index aa05f19..c2a0eaa 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_client.cc b/webkit/plugins/npapi/test/plugin_client.cc index 8358340..0b28250 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_client.h b/webkit/plugins/npapi/test/plugin_client.h index a6291b0..c06be2d 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_create_instance_in_paint.cc b/webkit/plugins/npapi/test/plugin_create_instance_in_paint.cc index f98f89b..09d6bdc 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_create_instance_in_paint.h b/webkit/plugins/npapi/test/plugin_create_instance_in_paint.h index 84d7a94..59f196f 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/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/plugins/npapi/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/plugins/npapi/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/plugins/npapi/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/plugins/npapi/test/plugin_get_javascript_url2_test.cc b/webkit/plugins/npapi/test/plugin_get_javascript_url2_test.cc index d17dced..e7595f2 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_get_javascript_url2_test.h b/webkit/plugins/npapi/test/plugin_get_javascript_url2_test.h index 557da76..b5c398e 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_get_javascript_url_test.cc b/webkit/plugins/npapi/test/plugin_get_javascript_url_test.cc index 50f5e5a..ea32fac 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_get_javascript_url_test.h b/webkit/plugins/npapi/test/plugin_get_javascript_url_test.h index 5c2540d..9aab3f9 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_geturl_test.cc b/webkit/plugins/npapi/test/plugin_geturl_test.cc index 5363a66..850a0b5 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_geturl_test.h b/webkit/plugins/npapi/test/plugin_geturl_test.h index df8d741..79c623b 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_javascript_open_popup.cc b/webkit/plugins/npapi/test/plugin_javascript_open_popup.cc index 0f93bf4..583a55e 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_javascript_open_popup.h b/webkit/plugins/npapi/test/plugin_javascript_open_popup.h index 552397a..6381d25 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_new_fails_test.cc b/webkit/plugins/npapi/test/plugin_new_fails_test.cc index 2feeec6..71cff01 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_new_fails_test.h b/webkit/plugins/npapi/test/plugin_new_fails_test.h index 1acf9e5..334323e 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_npobject_lifetime_test.cc b/webkit/plugins/npapi/test/plugin_npobject_lifetime_test.cc index 4564506..f493238 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_npobject_lifetime_test.h b/webkit/plugins/npapi/test/plugin_npobject_lifetime_test.h index 60d0314..12cf4e2 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_npobject_proxy_test.cc b/webkit/plugins/npapi/test/plugin_npobject_proxy_test.cc index 5b3a2ca..c9cd27f 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_npobject_proxy_test.h b/webkit/plugins/npapi/test/plugin_npobject_proxy_test.h index 3d14ddb..8585d0f 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_private_test.cc b/webkit/plugins/npapi/test/plugin_private_test.cc index cdab7ce..b3aabce 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_private_test.h b/webkit/plugins/npapi/test/plugin_private_test.h index db6b5d1..9079a11 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_schedule_timer_test.cc b/webkit/plugins/npapi/test/plugin_schedule_timer_test.cc index fbfce34..831ab29 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_schedule_timer_test.h b/webkit/plugins/npapi/test/plugin_schedule_timer_test.h index e3e6505a..043672c 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_setup_test.cc b/webkit/plugins/npapi/test/plugin_setup_test.cc index e4c4903..ded1379 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_setup_test.h b/webkit/plugins/npapi/test/plugin_setup_test.h index b01bc42..709b3b1 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_test.cc b/webkit/plugins/npapi/test/plugin_test.cc index 6717e4b..c948010 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_test.h b/webkit/plugins/npapi/test/plugin_test.h index f3f8937..fee09d3 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_test_factory.cc b/webkit/plugins/npapi/test/plugin_test_factory.cc index b4ae4f1..779ad00 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_test_factory.h b/webkit/plugins/npapi/test/plugin_test_factory.h index 3fd38d5..f1ed661 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_thread_async_call_test.cc b/webkit/plugins/npapi/test/plugin_thread_async_call_test.cc index c01a49e..e28f84e 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_thread_async_call_test.h b/webkit/plugins/npapi/test/plugin_thread_async_call_test.h index 78e4e8d..9e6a011 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_window_size_test.cc b/webkit/plugins/npapi/test/plugin_window_size_test.cc index 9bfabca..abc08ad 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_window_size_test.h b/webkit/plugins/npapi/test/plugin_window_size_test.h index 3650671..5a49479 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_windowed_test.cc b/webkit/plugins/npapi/test/plugin_windowed_test.cc index c82aa55..5635ec5 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_windowed_test.h b/webkit/plugins/npapi/test/plugin_windowed_test.h index 949ea86..4906933 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_windowless_test.cc b/webkit/plugins/npapi/test/plugin_windowless_test.cc index aa6a9d7..17b9ca7 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/plugin_windowless_test.h b/webkit/plugins/npapi/test/plugin_windowless_test.h index f336653..6f5ce15 100644 --- a/webkit/plugins/npapi/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/plugins/npapi/test/resource.h b/webkit/plugins/npapi/test/resource.h index c52fa82..422861f 100644 --- a/webkit/plugins/npapi/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/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/plugins/ppapi/url_request_info_unittest.cc b/webkit/plugins/ppapi/url_request_info_unittest.cc new file mode 100644 index 0000000..341eeb2 --- /dev/null +++ b/webkit/plugins/ppapi/url_request_info_unittest.cc @@ -0,0 +1,249 @@ +// 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 "third_party/WebKit/WebKit/chromium/public/WebFrame.h" +#include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h" +#include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" +#include "third_party/WebKit/WebKit/chromium/public/WebView.h" + +#include "webkit/plugins/ppapi/ppapi_plugin_instance.h" +#include "webkit/plugins/ppapi/ppb_url_request_info_impl.h" +#include "webkit/plugins/ppapi/ppapi_unittest.h" + +using WebKit::WebCString; +using WebKit::WebFrame; +using WebKit::WebFrameClient; +using WebKit::WebString; +using WebKit::WebView; +using WebKit::WebURL; +using WebKit::WebURLRequest; + +namespace { + +bool IsExpected(const WebCString& web_string, const char* expected) { + const char* result = web_string.data(); + return strcmp(result, expected) == 0; +} + +bool IsExpected(const WebString& web_string, const char* expected) { + return IsExpected(web_string.utf8(), expected); +} + +bool IsNullOrEmpty(const WebString& web_string) { + return web_string.isNull() || web_string.isEmpty(); +} + +// The base class destructor is protected, so derive. +class TestWebFrameClient : public WebFrameClient { +}; + +} // namespace + +namespace webkit { +namespace ppapi { + +class URLRequestInfoTest : public PpapiUnittest { + public: + URLRequestInfoTest() : info_(new PPB_URLRequestInfo_Impl(module())) { + } + + static void SetUpTestCase() { + web_view_ = WebView::create(0, 0); + web_view_->initializeMainFrame(&web_frame_client_); + WebURL web_url(GURL("")); + WebURLRequest url_request; + url_request.initialize(); + url_request.setURL(web_url); + frame_ = web_view_->mainFrame(); + frame_->loadRequest(url_request); + } + + static void TearDownTestCase() { + web_view_->close(); + } + + bool GetDownloadToFile() { + WebURLRequest web_request = info_->ToWebURLRequest(frame_); + return web_request.downloadToFile(); + } + + WebCString GetURL() { + WebURLRequest web_request = info_->ToWebURLRequest(frame_); + return web_request.url().spec(); + } + + WebString GetMethod() { + WebURLRequest web_request = info_->ToWebURLRequest(frame_); + return web_request.httpMethod(); + } + + WebString GetHeaderValue(const char* field) { + WebURLRequest web_request = info_->ToWebURLRequest(frame_); + return web_request.httpHeaderField(WebString::fromUTF8(field)); + } + + scoped_refptr<PPB_URLRequestInfo_Impl> info_; + + static TestWebFrameClient web_frame_client_; + static WebView* web_view_; + static WebFrame* frame_; +}; + +TestWebFrameClient URLRequestInfoTest::web_frame_client_; +WebView* URLRequestInfoTest::web_view_; +WebFrame* URLRequestInfoTest::frame_; + +TEST_F(URLRequestInfoTest, GetInterface) { + const PPB_URLRequestInfo* interface = info_->GetInterface(); + ASSERT_TRUE(interface); + ASSERT_TRUE(interface->Create); + ASSERT_TRUE(interface->IsURLRequestInfo); + ASSERT_TRUE(interface->SetProperty); + ASSERT_TRUE(interface->AppendDataToBody); + ASSERT_TRUE(interface->AppendFileToBody); + ASSERT_TRUE(interface->Create); + ASSERT_TRUE(interface->Create); +} + +TEST_F(URLRequestInfoTest, AsURLRequestInfo) { + ASSERT_EQ(info_, info_->AsPPB_URLRequestInfo_Impl()); +} + +TEST_F(URLRequestInfoTest, StreamToFile) { + info_->SetStringProperty(PP_URLREQUESTPROPERTY_URL, "http://www.google.com"); + + ASSERT_FALSE(GetDownloadToFile()); + + ASSERT_TRUE(info_->SetBooleanProperty( + PP_URLREQUESTPROPERTY_STREAMTOFILE, true)); + ASSERT_TRUE(GetDownloadToFile()); + + ASSERT_TRUE(info_->SetBooleanProperty( + PP_URLREQUESTPROPERTY_STREAMTOFILE, false)); + ASSERT_FALSE(GetDownloadToFile()); +} + +TEST_F(URLRequestInfoTest, FollowRedirects) { + ASSERT_TRUE(info_->follow_redirects()); + + ASSERT_TRUE(info_->SetBooleanProperty( + PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS, false)); + ASSERT_FALSE(info_->follow_redirects()); + + ASSERT_TRUE(info_->SetBooleanProperty( + PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS, true)); + ASSERT_TRUE(info_->follow_redirects()); +} + +TEST_F(URLRequestInfoTest, RecordDownloadProgress) { + ASSERT_FALSE(info_->record_download_progress()); + + ASSERT_TRUE(info_->SetBooleanProperty( + PP_URLREQUESTPROPERTY_RECORDDOWNLOADPROGRESS, true)); + ASSERT_TRUE(info_->record_download_progress()); + + ASSERT_TRUE(info_->SetBooleanProperty( + PP_URLREQUESTPROPERTY_RECORDDOWNLOADPROGRESS, false)); + ASSERT_FALSE(info_->record_download_progress()); +} + +TEST_F(URLRequestInfoTest, RecordUploadProgress) { + ASSERT_FALSE(info_->record_upload_progress()); + + ASSERT_TRUE(info_->SetBooleanProperty( + PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS, true)); + ASSERT_TRUE(info_->record_upload_progress()); + + ASSERT_TRUE(info_->SetBooleanProperty( + PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS, false)); + ASSERT_FALSE(info_->record_upload_progress()); +} + +TEST_F(URLRequestInfoTest, SetURL) { + // Test default URL is "about:blank". + ASSERT_TRUE(IsExpected(GetURL(), "about:blank")); + + const char* url = "http://www.google.com/"; + ASSERT_TRUE(info_->SetStringProperty( + PP_URLREQUESTPROPERTY_URL, url)); + ASSERT_TRUE(IsExpected(GetURL(), url)); +} + +TEST_F(URLRequestInfoTest, SetMethod) { + // Test default method is "GET". + ASSERT_TRUE(IsExpected(GetMethod(), "GET")); + ASSERT_TRUE(info_->SetStringProperty( + PP_URLREQUESTPROPERTY_METHOD, "POST")); + ASSERT_TRUE(IsExpected(GetMethod(), "POST")); +} + +TEST_F(URLRequestInfoTest, SetValidHeaders) { + // Test default header field. + ASSERT_TRUE(IsExpected( + GetHeaderValue("foo"), "")); + // Test that we can set a header field. + ASSERT_TRUE(info_->SetStringProperty( + PP_URLREQUESTPROPERTY_HEADERS, "foo: bar")); + ASSERT_TRUE(IsExpected( + GetHeaderValue("foo"), "bar")); + // Test that we can set multiple header fields using \n delimiter. + ASSERT_TRUE(info_->SetStringProperty( + PP_URLREQUESTPROPERTY_HEADERS, "foo: bar\nbar: baz")); + ASSERT_TRUE(IsExpected( + GetHeaderValue("foo"), "bar")); + ASSERT_TRUE(IsExpected( + GetHeaderValue("bar"), "baz")); +} + +TEST_F(URLRequestInfoTest, SetInvalidHeaders) { + const char* const kForbiddenHeaderFields[] = { + "accept-charset", + "accept-encoding", + "connection", + "content-length", + "cookie", + "cookie2", + "content-transfer-encoding", + "date", + "expect", + "host", + "keep-alive", + "origin", + "referer", + "te", + "trailer", + "transfer-encoding", + "upgrade", + "user-agent", + "via", + + "proxy-foo", // Test for any header starting with proxy- or sec-. + "sec-foo", + }; + + // Test that no forbidden header fields can be set. + for (size_t i = 0; i < arraysize(kForbiddenHeaderFields); ++i) { + std::string headers(kForbiddenHeaderFields[i]); + headers.append(": foo"); + ASSERT_FALSE(info_->SetStringProperty( + PP_URLREQUESTPROPERTY_HEADERS, headers.c_str())); + ASSERT_TRUE(IsNullOrEmpty(GetHeaderValue(kForbiddenHeaderFields[i]))); + } + + // Test that forbidden header can't be set in various ways. + ASSERT_FALSE(info_->SetStringProperty( + PP_URLREQUESTPROPERTY_HEADERS, "cookie : foo")); + ASSERT_TRUE(IsNullOrEmpty(GetHeaderValue("cookie"))); + + // Test that forbidden header can't be set with an allowed one. + ASSERT_FALSE(info_->SetStringProperty( + PP_URLREQUESTPROPERTY_HEADERS, "foo: bar\ncookie: foo")); + ASSERT_TRUE(IsNullOrEmpty(GetHeaderValue("cookie"))); +} + +// TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody. + +} // namespace ppapi +} // namespace webkit + 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/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 bec7e53..9ebd278 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,12 +411,18 @@ '../../mocks/mock_resource_loader_bridge.h', '../../mocks/mock_webframe.h', '../../mocks/mock_weburlloader.h', + '../../plugins/npapi/plugin_group_unittest.cc', + '../../plugins/npapi/plugin_group_unittest.cc', + '../../plugins/npapi/plugin_lib_unittest.cc', + '../../plugins/npapi/plugin_lib_unittest.cc', + '../../plugins/npapi/webplugin_impl_unittest.cc', '../../plugins/ppapi/mock_plugin_delegate.cc', '../../plugins/ppapi/mock_plugin_delegate.h', '../../plugins/ppapi/mock_resource.h', '../../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', @@ -513,13 +515,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', ], }, { @@ -535,51 +537,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"', { @@ -587,16 +589,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"', { @@ -610,7 +612,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")', { 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; |