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

Unified Diff: Source/modules/screen_orientation/ScreenOrientation.h

Issue 374623002: [screen-orientation] Update implementation to match recent spec changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix move Created 6 years, 5 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
Index: Source/modules/screen_orientation/ScreenOrientation.h
diff --git a/Source/modules/screen_orientation/ScreenOrientation.h b/Source/modules/screen_orientation/ScreenOrientation.h
index 1091cdb224e11d9e0cc04593744091375c632c2e..71e451e3c4f0a18afc259b0823796945d0c7e366 100644
--- a/Source/modules/screen_orientation/ScreenOrientation.h
+++ b/Source/modules/screen_orientation/ScreenOrientation.h
@@ -5,42 +5,62 @@
#ifndef ScreenOrientation_h
#define ScreenOrientation_h
-#include "core/frame/DOMWindowProperty.h"
-#include "platform/Supplementable.h"
-#include "platform/Timer.h"
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/dom/ActiveDOMObject.h"
+#include "core/events/EventTarget.h"
#include "platform/heap/Handle.h"
-#include "public/platform/WebScreenOrientationLockType.h"
#include "public/platform/WebScreenOrientationType.h"
#include "wtf/text/AtomicString.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
-class Document;
+class ExecutionContext;
class ScriptPromise;
class ScriptState;
-class Screen;
+class ScreenOrientationController;
-class ScreenOrientation FINAL : public NoBaseWillBeGarbageCollectedFinalized<ScreenOrientation>, public WillBeHeapSupplement<Screen>, DOMWindowProperty {
+class ScreenOrientation FINAL :
+ public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<ScreenOrientation>,
+ public EventTargetWithInlineData,
+ public ActiveDOMObject {
abarth-chromium 2014/07/07 17:29:33 You shouldn't need to be an ActiveDOMObject
mlamouri (slow - plz ping) 2014/07/08 14:07:59 So, I tried to find out when ActiveDOMObject was n
+ DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<ScreenOrientation>);
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientation);
public:
- static ScreenOrientation& from(Screen&);
+ static ScreenOrientation* create(ScreenOrientationController*, ExecutionContext*);
+
virtual ~ScreenOrientation();
- static const AtomicString& orientation(Screen&);
- static ScriptPromise lockOrientation(ScriptState*, Screen&, const AtomicString& orientation);
- static void unlockOrientation(Screen&);
+ // EventTarget implementation.
+ virtual const WTF::AtomicString& interfaceName() const OVERRIDE;
+ virtual ExecutionContext* executionContext() const OVERRIDE;
+
+ String type() const;
+ unsigned short angle() const;
+
+ void setType(blink::WebScreenOrientationType);
+ void setAngle(unsigned short);
+
+ ScriptPromise lock(ScriptState*, const AtomicString& orientation);
+ void unlock();
+
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(change);
+
+ // ActiveDOMObject overrides.
+ virtual bool hasPendingActivity() const OVERRIDE;
// Helper being used by this class and LockOrientationCallback.
static const AtomicString& orientationTypeToString(blink::WebScreenOrientationType);
- virtual void trace(Visitor* visitor) OVERRIDE { WillBeHeapSupplement<Screen>::trace(visitor); }
+ virtual void trace(Visitor*) OVERRIDE;
private:
- explicit ScreenOrientation(Screen&);
+ explicit ScreenOrientation(ScreenOrientationController*, ExecutionContext*);
+
+ ScreenOrientationController* m_controller;
- static const char* supplementName();
- Document* document() const;
+ blink::WebScreenOrientationType m_type;
+ unsigned short m_angle;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698