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

Unified Diff: content/browser/renderer_host/gamepad_monitor.cc

Issue 2563483006: Move gamepad_service out of content/ and into device/ (Closed)
Patch Set: addressed Blundell's review comments Created 4 years 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
Index: content/browser/renderer_host/gamepad_monitor.cc
diff --git a/content/browser/renderer_host/gamepad_monitor.cc b/content/browser/renderer_host/gamepad_monitor.cc
deleted file mode 100644
index 4ac85f840b30e67b0c61934155a1e8b37ead4c51..0000000000000000000000000000000000000000
--- a/content/browser/renderer_host/gamepad_monitor.cc
+++ /dev/null
@@ -1,65 +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.
-
-#include "content/browser/renderer_host/gamepad_monitor.h"
-
-#include "base/memory/shared_memory.h"
-#include "content/browser/gamepad/gamepad_service.h"
-#include "content/common/gamepad_hardware_buffer.h"
-#include "content/public/browser/browser_thread.h"
-#include "mojo/public/cpp/bindings/strong_binding.h"
-
-namespace content {
-
-GamepadMonitor::GamepadMonitor() : is_started_(false) {}
-
-GamepadMonitor::~GamepadMonitor() {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- if (is_started_)
- GamepadService::GetInstance()->RemoveConsumer(this);
-}
-
-// static
-void GamepadMonitor::Create(device::mojom::GamepadMonitorRequest request) {
- mojo::MakeStrongBinding(base::MakeUnique<GamepadMonitor>(),
- std::move(request));
-}
-
-void GamepadMonitor::OnGamepadConnected(unsigned index,
- const blink::WebGamepad& gamepad) {
- if (gamepad_observer_)
- gamepad_observer_->GamepadConnected(index, gamepad);
-}
-
-void GamepadMonitor::OnGamepadDisconnected(unsigned index,
- const blink::WebGamepad& gamepad) {
- if (gamepad_observer_)
- gamepad_observer_->GamepadDisconnected(index, gamepad);
-}
-
-void GamepadMonitor::GamepadStartPolling(
- const GamepadStartPollingCallback& callback) {
- DCHECK(!is_started_);
- is_started_ = true;
-
- GamepadService* service = GamepadService::GetInstance();
- service->ConsumerBecameActive(this);
- callback.Run(service->GetSharedBufferHandle());
-}
-
-void GamepadMonitor::GamepadStopPolling(
- const GamepadStopPollingCallback& callback) {
- DCHECK(is_started_);
- is_started_ = false;
-
- GamepadService::GetInstance()->ConsumerBecameInactive(this);
- callback.Run();
-}
-
-void GamepadMonitor::SetObserver(
- device::mojom::GamepadObserverPtr gamepad_observer) {
- gamepad_observer_ = std::move(gamepad_observer);
-}
-
-} // namespace content
« no previous file with comments | « content/browser/renderer_host/gamepad_monitor.h ('k') | content/browser/renderer_host/pepper/pepper_gamepad_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698