Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/renderer_host/input/input_device_change_observer.h" | |
| 6 | |
| 7 #if defined(OS_WIN) | |
| 8 #include "ui/events/devices/input_device_observer_win.h" | |
| 9 #endif | |
| 10 | |
| 11 namespace content { | |
| 12 | |
| 13 InputDeviceChangeObserver::InputDeviceChangeObserver(RenderViewHost* rvh) { | |
| 14 render_view_host_ = rvh; | |
| 15 #if defined(OS_WIN) | |
| 16 ui::InputDeviceObserverWin::GetInstance()->AddObserver(this); | |
| 17 #endif | |
| 18 } | |
| 19 | |
| 20 InputDeviceChangeObserver::~InputDeviceChangeObserver() { | |
| 21 #if defined(OS_WIN) | |
| 22 ui::InputDeviceObserverWin::GetInstance()->RemoveObserver(this); | |
| 23 #endif | |
| 24 render_view_host_ = nullptr; | |
| 25 } | |
| 26 | |
| 27 void InputDeviceChangeObserver::OnTouchscreenDeviceConfigurationChanged() { | |
| 28 notifyRenderViewHost(); | |
| 29 } | |
| 30 | |
| 31 void InputDeviceChangeObserver::OnKeyboardDeviceConfigurationChanged() { | |
| 32 notifyRenderViewHost(); | |
| 33 } | |
| 34 | |
| 35 void InputDeviceChangeObserver::OnMouseDeviceConfigurationChanged() { | |
| 36 notifyRenderViewHost(); | |
| 37 } | |
| 38 | |
| 39 void InputDeviceChangeObserver::OnTouchpadDeviceConfigurationChanged() { | |
| 40 notifyRenderViewHost(); | |
| 41 } | |
| 42 | |
| 43 void InputDeviceChangeObserver::notifyRenderViewHost() { | |
| 44 if (render_view_host_->InputDeviceFeaturesChanged()) | |
|
Rick Byers
2017/04/05 18:45:50
In case there turns out to be some pathological ca
| |
| 45 render_view_host_->OnWebkitPreferencesChanged(); | |
| 46 } | |
| 47 | |
| 48 } // namespace content | |
| OLD | NEW |