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) 2012 Apple Inc. All rights reserved. | 6 * Copyright (C) 2012 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 20 matching lines...) Expand all Loading... |
31 | 31 |
32 #include <stdio.h> | 32 #include <stdio.h> |
33 | 33 |
34 using namespace std; | 34 using namespace std; |
35 | 35 |
36 class LogNPPSetWindow : public PluginTest { | 36 class LogNPPSetWindow : public PluginTest { |
37 public: | 37 public: |
38 LogNPPSetWindow(NPP, const string& identifier); | 38 LogNPPSetWindow(NPP, const string& identifier); |
39 | 39 |
40 private: | 40 private: |
41 virtual NPError NPP_SetWindow(NPWindow*) OVERRIDE; | 41 virtual NPError NPP_SetWindow(NPWindow*) override; |
42 }; | 42 }; |
43 | 43 |
44 LogNPPSetWindow::LogNPPSetWindow(NPP npp, const string& identifier) | 44 LogNPPSetWindow::LogNPPSetWindow(NPP npp, const string& identifier) |
45 : PluginTest(npp, identifier) | 45 : PluginTest(npp, identifier) |
46 { | 46 { |
47 } | 47 } |
48 | 48 |
49 NPError LogNPPSetWindow::NPP_SetWindow(NPWindow* window) | 49 NPError LogNPPSetWindow::NPP_SetWindow(NPWindow* window) |
50 { | 50 { |
51 char message[1024]; | 51 char message[1024]; |
52 snprintf(message, 1024, "NPP_SetWindow: %s window, Rect {%i, %i, %i, %i}, Cl
ip Rect {%i, %i, %i, %i}, Type %i", | 52 snprintf(message, 1024, "NPP_SetWindow: %s window, Rect {%i, %i, %i, %i}, Cl
ip Rect {%i, %i, %i, %i}, Type %i", |
53 window->window ? "non-NULL" : "NULL", window->x, window->y, window->widt
h, window->height, | 53 window->window ? "non-NULL" : "NULL", window->x, window->y, window->widt
h, window->height, |
54 window->clipRect.left, window->clipRect.top, window->clipRect.right, win
dow->clipRect.bottom, | 54 window->clipRect.left, window->clipRect.top, window->clipRect.right, win
dow->clipRect.bottom, |
55 window->type); | 55 window->type); |
56 | 56 |
57 char script[1536]; | 57 char script[1536]; |
58 snprintf(script, 1536, "window.setTimeout('windowWasSet(\"%s\");', 0);", mes
sage); | 58 snprintf(script, 1536, "window.setTimeout('windowWasSet(\"%s\");', 0);", mes
sage); |
59 | 59 |
60 executeScript(script); | 60 executeScript(script); |
61 | 61 |
62 return NPERR_NO_ERROR; | 62 return NPERR_NO_ERROR; |
63 } | 63 } |
64 | 64 |
65 static PluginTest::Register<LogNPPSetWindow> registrar("log-npp-set-window"); | 65 static PluginTest::Register<LogNPPSetWindow> registrar("log-npp-set-window"); |
OLD | NEW |