| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "webkit/glue/plugins/test/plugin_windowed_test.h" |
| 6 #include "webkit/glue/plugins/test/plugin_client.h" |
| 7 |
| 8 namespace NPAPIClient { |
| 9 |
| 10 WindowedPluginTest::WindowedPluginTest(NPP id, NPNetscapeFuncs *host_functions) |
| 11 : PluginTest(id, host_functions) { |
| 12 } |
| 13 |
| 14 NPError WindowedPluginTest::SetWindow(NPWindow* pNPWindow) { |
| 15 HWND window = reinterpret_cast<HWND>(pNPWindow->window); |
| 16 if (!pNPWindow || !::IsWindow(window)) { |
| 17 SetError("Invalid arguments passed in"); |
| 18 return NPERR_INVALID_PARAM; |
| 19 } |
| 20 |
| 21 if (test_name() == "hidden_plugin") { |
| 22 NPIdentifier function_id; |
| 23 if (IsWindowVisible(window)) { |
| 24 function_id = HostFunctions()->getstringidentifier("windowVisible"); |
| 25 } else { |
| 26 function_id = HostFunctions()->getstringidentifier("windowHidden"); |
| 27 } |
| 28 |
| 29 NPVariant rv; |
| 30 NPObject *window_obj = NULL; |
| 31 HostFunctions()->getvalue(id(), NPNVWindowNPObject, &window_obj); |
| 32 HostFunctions()->invoke(id(), window_obj, function_id, NULL, 0, &rv); |
| 33 } |
| 34 |
| 35 return NPERR_NO_ERROR; |
| 36 } |
| 37 |
| 38 } // namespace NPAPIClient |
| OLD | NEW |