Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (C) 2011, Google Inc. All rights reserved. | 1 // Copyright (C) 2011, Google Inc. All rights reserved. |
| 2 // | 2 // |
| 3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
| 4 // modification, are permitted provided that the following conditions are met: | 4 // modification, are permitted provided that the following conditions are met: |
| 5 // | 5 // |
| 6 // 1. Redistributions of source code must retain the above copyright | 6 // 1. Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // 2. Redistributions in binary form must reproduce the above copyright | 8 // 2. Redistributions in binary form must reproduce the above copyright |
| 9 // notice, this list of conditions and the following disclaimer in the | 9 // notice, this list of conditions and the following disclaimer in the |
| 10 // documentation and/or other materials provided with the distribution. | 10 // documentation and/or other materials provided with the distribution. |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 #define WebGamepads_h | 25 #define WebGamepads_h |
| 26 | 26 |
| 27 #include "WebGamepad.h" | 27 #include "WebGamepad.h" |
| 28 | 28 |
| 29 #if BLINK_IMPLEMENTATION | 29 #if BLINK_IMPLEMENTATION |
| 30 #include "wtf/Assertions.h" | 30 #include "wtf/Assertions.h" |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 class WebGamepadListener { | |
| 36 public: | |
| 37 virtual void onGamepadConnected(unsigned index, const blink::WebGamepad&) = 0; | |
| 38 virtual void onGamepadDisconnected(unsigned index, const blink::WebGamepad&) = 0; | |
| 39 | |
| 40 protected: | |
| 41 virtual ~WebGamepadListener() { } | |
| 42 }; | |
|
abarth-chromium
2014/03/17 18:23:46
Please put new classes into their own headers.
kbalazs
2014/03/17 23:49:27
Done.
| |
| 43 | |
| 35 #pragma pack(push, 1) | 44 #pragma pack(push, 1) |
| 36 | 45 |
| 37 // This structure is intentionally POD and fixed size so that it can be stored | 46 // This structure is intentionally POD and fixed size so that it can be stored |
| 38 // in shared memory between hardware polling threads and the rest of the | 47 // in shared memory between hardware polling threads and the rest of the |
| 39 // browser. | 48 // browser. |
| 40 class WebGamepads { | 49 class WebGamepads { |
| 41 public: | 50 public: |
| 42 WebGamepads() | 51 WebGamepads() |
| 43 : length(0) { } | 52 : length(0) { } |
| 44 | 53 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 57 #else | 66 #else |
| 58 COMPILE_ASSERT(sizeof(WebGamepads) == 1864, WebGamepads_has_wrong_size); | 67 COMPILE_ASSERT(sizeof(WebGamepads) == 1864, WebGamepads_has_wrong_size); |
| 59 #endif | 68 #endif |
| 60 #endif | 69 #endif |
| 61 | 70 |
| 62 #pragma pack(pop) | 71 #pragma pack(pop) |
| 63 | 72 |
| 64 } | 73 } |
| 65 | 74 |
| 66 #endif // WebGamepads_h | 75 #endif // WebGamepads_h |
| OLD | NEW |