Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1163)

Unified Diff: content/browser/gamepad/gamepad_data_fetcher.h

Issue 2081583002: Migrating majority of gamepad from content/browser/ to device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final tweaks Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gamepad/gamepad_consumer.h ('k') | content/browser/gamepad/gamepad_data_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gamepad/gamepad_data_fetcher.h
diff --git a/content/browser/gamepad/gamepad_data_fetcher.h b/content/browser/gamepad/gamepad_data_fetcher.h
deleted file mode 100644
index a395fd9b0d20a931090b6a5feefbc285975465e2..0000000000000000000000000000000000000000
--- a/content/browser/gamepad/gamepad_data_fetcher.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_BROWSER_GAMEPAD_GAMEPAD_DATA_FETCHER_H_
-#define CONTENT_BROWSER_GAMEPAD_GAMEPAD_DATA_FETCHER_H_
-
-#include <stdint.h>
-
-#include "build/build_config.h"
-#include "content/browser/gamepad/gamepad_standard_mappings.h"
-#include "third_party/WebKit/public/platform/WebGamepads.h"
-
-namespace content {
-
-// Abstract interface for imlementing platform- (and test-) specific behaviro
-// for getting the gamepad data.
-class GamepadDataFetcher {
- public:
- virtual ~GamepadDataFetcher() {}
- virtual void GetGamepadData(blink::WebGamepads* pads,
- bool devices_changed_hint) = 0;
- virtual void PauseHint(bool paused) {}
-
-#if !defined(OS_ANDROID)
- struct PadState {
- // Gamepad data, unmapped.
- blink::WebGamepad data;
-
- // Functions to map from device data to standard layout, if available. May
- // be null if no mapping is available.
- GamepadStandardMappingFunction mapper;
-
- // Sanitization masks
- // axis_mask and button_mask are bitfields that represent the reset state of
- // each input. If a button or axis has ever reported 0 in the past the
- // corresponding bit will be set to 1.
-
- // If we ever increase the max axis count this will need to be updated.
- static_assert(blink::WebGamepad::axesLengthCap <=
- std::numeric_limits<uint32_t>::digits,
- "axis_mask is not large enough");
- uint32_t axis_mask;
-
- // If we ever increase the max button count this will need to be updated.
- static_assert(blink::WebGamepad::buttonsLengthCap <=
- std::numeric_limits<uint32_t>::digits,
- "button_mask is not large enough");
- uint32_t button_mask;
- };
-
- void MapAndSanitizeGamepadData(PadState* pad_state, blink::WebGamepad* pad);
-
- protected:
- PadState pad_state_[blink::WebGamepads::itemsLengthCap];
-#endif
-};
-
-} // namespace content
-
-#endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_DATA_FETCHER_H_
« no previous file with comments | « content/browser/gamepad/gamepad_consumer.h ('k') | content/browser/gamepad/gamepad_data_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698