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

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

Issue 209333008: [DevTools] Support device orientation override on device with sensors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebaselined test Created 6 years, 9 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 26 matching lines...) Expand all
37 class DeviceOrientationData; 37 class DeviceOrientationData;
38 38
39 class DeviceOrientationController FINAL : public DeviceSensorEventController, pu blic DocumentSupplement, public DOMWindowLifecycleObserver { 39 class DeviceOrientationController FINAL : public DeviceSensorEventController, pu blic DocumentSupplement, public DOMWindowLifecycleObserver {
40 40
41 public: 41 public:
42 virtual ~DeviceOrientationController(); 42 virtual ~DeviceOrientationController();
43 43
44 static const char* supplementName(); 44 static const char* supplementName();
45 static DeviceOrientationController& from(Document&); 45 static DeviceOrientationController& from(Document&);
46 46
47 void didChangeDeviceOrientation(WebCore::DeviceOrientationData*); 47 void didChangeDeviceOrientation(DeviceOrientationData*);
48 void setOverride(DeviceOrientationData*);
49 void clearOverride();
48 50
49 // Inherited from DOMWindowLifecycleObserver 51 // Inherited from DOMWindowLifecycleObserver
50 virtual void didAddEventListener(DOMWindow*, const AtomicString&) OVERRIDE; 52 virtual void didAddEventListener(DOMWindow*, const AtomicString&) OVERRIDE;
51 virtual void didRemoveEventListener(DOMWindow*, const AtomicString&) OVERRID E; 53 virtual void didRemoveEventListener(DOMWindow*, const AtomicString&) OVERRID E;
52 virtual void didRemoveAllEventListeners(DOMWindow*) OVERRIDE; 54 virtual void didRemoveAllEventListeners(DOMWindow*) OVERRIDE;
53 55
54 private: 56 private:
55 explicit DeviceOrientationController(Document&); 57 explicit DeviceOrientationController(Document&);
56 virtual void registerWithDispatcher() OVERRIDE; 58 virtual void registerWithDispatcher() OVERRIDE;
57 virtual void unregisterWithDispatcher() OVERRIDE; 59 virtual void unregisterWithDispatcher() OVERRIDE;
58 60
61 DeviceOrientationData* lastData();
59 virtual bool hasLastData() OVERRIDE; 62 virtual bool hasLastData() OVERRIDE;
60 virtual PassRefPtr<Event> getLastEvent() OVERRIDE; 63 virtual PassRefPtr<Event> getLastEvent() OVERRIDE;
61 virtual bool isNullEvent(Event*) OVERRIDE; 64 virtual bool isNullEvent(Event*) OVERRIDE;
65
66 RefPtrWillBeMember<DeviceOrientationData> m_overrideOrientationData;
62 }; 67 };
63 68
64 } // namespace WebCore 69 } // namespace WebCore
65 70
66 #endif // DeviceOrientationController_h 71 #endif // DeviceOrientationController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698