OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 gamepad->buttons(webGamepad.buttonsLength, webGamepad.buttons); | 52 gamepad->buttons(webGamepad.buttonsLength, webGamepad.buttons); |
53 into->set(i, gamepad); | 53 into->set(i, gamepad); |
54 } else { | 54 } else { |
55 into->set(i, 0); | 55 into->set(i, 0); |
56 } | 56 } |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 NavigatorGamepad::NavigatorGamepad() | 60 NavigatorGamepad::NavigatorGamepad() |
61 { | 61 { |
62 blink::Platform::current()->resumeGamepads(); | |
62 } | 63 } |
63 | 64 |
64 NavigatorGamepad::~NavigatorGamepad() | 65 NavigatorGamepad::~NavigatorGamepad() |
65 { | 66 { |
67 blink::Platform::current()->pauseGamepads(); | |
scottmg
2014/02/06 20:46:23
I don't think the renderer should be telling the b
| |
66 } | 68 } |
67 | 69 |
68 const char* NavigatorGamepad::supplementName() | 70 const char* NavigatorGamepad::supplementName() |
69 { | 71 { |
70 return "NavigatorGamepad"; | 72 return "NavigatorGamepad"; |
71 } | 73 } |
72 | 74 |
73 NavigatorGamepad* NavigatorGamepad::from(Navigator* navigator) | 75 NavigatorGamepad* NavigatorGamepad::from(Navigator* navigator) |
74 { | 76 { |
75 NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(Supplement<Nav igator>::from(navigator, supplementName())); | 77 NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(Supplement<Nav igator>::from(navigator, supplementName())); |
(...skipping 11 matching lines...) Expand all Loading... | |
87 | 89 |
88 GamepadList* NavigatorGamepad::gamepads() | 90 GamepadList* NavigatorGamepad::gamepads() |
89 { | 91 { |
90 if (!m_gamepads) | 92 if (!m_gamepads) |
91 m_gamepads = GamepadList::create(); | 93 m_gamepads = GamepadList::create(); |
92 sampleGamepads(m_gamepads.get()); | 94 sampleGamepads(m_gamepads.get()); |
93 return m_gamepads.get(); | 95 return m_gamepads.get(); |
94 } | 96 } |
95 | 97 |
96 } // namespace WebCore | 98 } // namespace WebCore |
OLD | NEW |