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

Side by Side Diff: Source/modules/device_orientation/DeviceOrientationController.cpp

Issue 256593010: Gracefully support Navigator Gamepad methods in a detached state. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2010 Apple Inc. All rights reserved. 2 * Copyright 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Samsung Electronics. All rights reserved. 3 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright 10 * * Redistributions in binary form must reproduce the above copyright
(...skipping 19 matching lines...) Expand all
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 #include "core/frame/DOMWindow.h" 31 #include "core/frame/DOMWindow.h"
32 #include "core/page/Page.h" 32 #include "core/page/Page.h"
33 #include "modules/device_orientation/DeviceOrientationData.h" 33 #include "modules/device_orientation/DeviceOrientationData.h"
34 #include "modules/device_orientation/DeviceOrientationDispatcher.h" 34 #include "modules/device_orientation/DeviceOrientationDispatcher.h"
35 #include "modules/device_orientation/DeviceOrientationEvent.h" 35 #include "modules/device_orientation/DeviceOrientationEvent.h"
36 36
37 namespace WebCore { 37 namespace WebCore {
38 38
39 DeviceOrientationController::DeviceOrientationController(Document& document) 39 DeviceOrientationController::DeviceOrientationController(Document& document)
40 : DeviceSensorEventController(document) 40 : DeviceSensorEventController(&document)
41 , DOMWindowLifecycleObserver(document.domWindow()) 41 , DOMWindowLifecycleObserver(document.domWindow())
42 { 42 {
43 } 43 }
44 44
45 DeviceOrientationController::~DeviceOrientationController() 45 DeviceOrientationController::~DeviceOrientationController()
46 { 46 {
47 stopUpdating(); 47 stopUpdating();
48 } 48 }
49 49
50 void DeviceOrientationController::didChangeDeviceOrientation(DeviceOrientationDa ta* deviceOrientationData) 50 void DeviceOrientationController::didChangeDeviceOrientation(DeviceOrientationDa ta* deviceOrientationData)
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 { 137 {
138 if (!m_overrideOrientationData) 138 if (!m_overrideOrientationData)
139 return; 139 return;
140 m_overrideOrientationData.clear(); 140 m_overrideOrientationData.clear();
141 DeviceOrientationData* orientation = lastData(); 141 DeviceOrientationData* orientation = lastData();
142 if (orientation) 142 if (orientation)
143 didChangeDeviceOrientation(orientation); 143 didChangeDeviceOrientation(orientation);
144 } 144 }
145 145
146 } // namespace WebCore 146 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698