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

Unified Diff: content/browser/gamepad/raw_input_data_fetcher_win.cc

Issue 1113913003: Allow Raw Input gamepads to persist across page refreshes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shield_mapping
Patch Set: Created 5 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gamepad/raw_input_data_fetcher_win.cc
diff --git a/content/browser/gamepad/raw_input_data_fetcher_win.cc b/content/browser/gamepad/raw_input_data_fetcher_win.cc
index 3a8788443fa939e97ba3a6388cb64d19db84f2cf..949e6fd10e235eb0d8b6084133414352c493ba48 100644
--- a/content/browser/gamepad/raw_input_data_fetcher_win.cc
+++ b/content/browser/gamepad/raw_input_data_fetcher_win.cc
@@ -41,6 +41,7 @@ RawInputDataFetcher::RawInputDataFetcher()
, events_monitored_(false) {}
RawInputDataFetcher::~RawInputDataFetcher() {
+ ClearControllers();
DCHECK(!window_);
DCHECK(!events_monitored_);
}
@@ -56,7 +57,7 @@ RAWINPUTDEVICE* RawInputDataFetcher::GetRawInputDevices(DWORD flags) {
devices[i].dwFlags = flags;
devices[i].usUsagePage = 1;
devices[i].usUsage = DeviceUsages[i];
- devices[i].hwndTarget = window_->hwnd();
+ devices[i].hwndTarget = (flags & RIDEV_REMOVE) ? 0 : window_->hwnd();
}
return devices.release();
}
@@ -107,7 +108,6 @@ void RawInputDataFetcher::StopMonitor() {
events_monitored_ = false;
window_.reset();
- ClearControllers();
// Stop observing message loop destruction if no event is being monitored.
base::MessageLoop::current()->RemoveDestructionObserver(this);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698