Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /* | 5 /* |
| 6 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 6 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 257 char* script = argv[i]; | 257 char* script = argv[i]; |
| 258 if (script == strstr(script, "mouse::")) { | 258 if (script == strstr(script, "mouse::")) { |
| 259 obj->mouseDownForEvaluateScript = true; | 259 obj->mouseDownForEvaluateScript = true; |
| 260 obj->evaluateScriptOnMouseDownOrKeyDown = base::strdup(script + sizeof("mouse::") - 1); | 260 obj->evaluateScriptOnMouseDownOrKeyDown = base::strdup(script + sizeof("mouse::") - 1); |
| 261 } else if (script == strstr(script, "key::")) { | 261 } else if (script == strstr(script, "key::")) { |
| 262 obj->evaluateScriptOnMouseDownOrKeyDown = base::strdup(script + sizeof("key::") - 1); | 262 obj->evaluateScriptOnMouseDownOrKeyDown = base::strdup(script + sizeof("key::") - 1); |
| 263 } | 263 } |
| 264 // When testing evaluate script on mouse-down or key-down, allow eve nt logging to handle events. | 264 // When testing evaluate script on mouse-down or key-down, allow eve nt logging to handle events. |
| 265 if (obj->evaluateScriptOnMouseDownOrKeyDown) | 265 if (obj->evaluateScriptOnMouseDownOrKeyDown) |
| 266 obj->eventLogging = true; | 266 obj->eventLogging = true; |
| 267 } else if (!strcasecmp(argn[i], "windowedPlugin")) { | |
| 268 void* windowed = 0; | |
| 269 if (!strcasecmp(argv[i], "false") || !strcasecmp(argv[i], "0")) | |
| 270 windowed = 0; | |
| 271 else if (!strcasecmp(argv[i], "true") || !strcasecmp(argv[i], "1")) | |
| 272 windowed = reinterpret_cast<void*>(1); | |
| 273 else | |
| 274 assert(false); | |
| 275 browser->setvalue(instance, NPPVpluginWindowBool, windowed); | |
| 276 } else if (!strcasecmp(argn[i], "alwaysFilterEvents")) { | 267 } else if (!strcasecmp(argn[i], "alwaysFilterEvents")) { |
| 277 obj->alwaysFilterEvents = true; | 268 obj->alwaysFilterEvents = true; |
| 278 } | 269 } |
| 279 } | 270 } |
| 271 void* windowed = 0; | |
| 272 browser->setvalue(instance, NPPVpluginWindowBool, windowed); | |
|
dcheng
2016/03/18 06:10:53
o.O
piman
2016/03/18 15:55:40
NPAPI is insane. Not my fault :)
| |
| 280 | 273 |
| 281 #ifdef XP_MACOSX | 274 #ifdef XP_MACOSX |
| 282 browser->setvalue(instance, NPPVpluginDrawingModel, (void *)NPDrawingModelCo reGraphics); | 275 browser->setvalue(instance, NPPVpluginDrawingModel, (void *)NPDrawingModelCo reGraphics); |
| 283 #endif | 276 #endif |
| 284 | 277 |
| 285 obj->pluginTest = PluginTest::create(instance, testIdentifier); | 278 obj->pluginTest = PluginTest::create(instance, testIdentifier); |
| 286 | 279 |
| 287 if (!obj->pluginTest) { | 280 if (!obj->pluginTest) { |
| 288 pluginLog(instance, "NPP_New: Could not find a test named \"%s\", maybe its .cpp file wasn't added to the build system?", testIdentifier.c_str()); | 281 pluginLog(instance, "NPP_New: Could not find a test named \"%s\", maybe its .cpp file wasn't added to the build system?", testIdentifier.c_str()); |
| 289 return NPERR_GENERIC_ERROR; | 282 return NPERR_GENERIC_ERROR; |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 853 { | 846 { |
| 854 return "application/x-webkit-test-netscape:testnetscape:test netscape conten t;image/png:png:PNG image"; | 847 return "application/x-webkit-test-netscape:testnetscape:test netscape conten t;image/png:png:PNG image"; |
| 855 } | 848 } |
| 856 | 849 |
| 857 extern "C" | 850 extern "C" |
| 858 NPError NP_GetValue(NPP instance, NPPVariable variable, void* value) | 851 NPError NP_GetValue(NPP instance, NPPVariable variable, void* value) |
| 859 { | 852 { |
| 860 return NPP_GetValue(instance, variable, value); | 853 return NPP_GetValue(instance, variable, value); |
| 861 } | 854 } |
| 862 #endif | 855 #endif |
| OLD | NEW |