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

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

Issue 168763002: Add initial Screen Orientation API support: IDL changes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take Adam's feedback into consideration Created 6 years, 10 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
new file mode 100644
index 0000000000000000000000000000000000000000..af93361241f5cc0dbe873396d714acd7c25e8d5d
--- /dev/null
+++ b/Source/modules/screen_orientation/ScreenOrientation.h
@@ -0,0 +1,40 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
abarth-chromium 2014/02/16 09:14:11 You've got an extra blank line here.
Inactive 2014/02/16 14:09:14 Done.
+#ifndef ScreenOrientation_h
+#define ScreenOrientation_h
+
+#include "core/events/EventTarget.h"
+#include "core/frame/DOMWindowProperty.h"
+#include "platform/Supplementable.h"
+#include "wtf/Vector.h"
+#include "wtf/text/AtomicString.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+class Screen;
+
+class ScreenOrientation FINAL : public Supplement<Screen>, DOMWindowProperty {
+public:
+ static ScreenOrientation* from(Screen*);
+ virtual ~ScreenOrientation();
+
+ DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(orientationchange);
+
+ static const AtomicString& orientation(Screen*);
+ static bool lockOrientation(Screen*, const Vector<String>& orientations);
+ static bool lockOrientation(Screen*, const AtomicString& orientation);
+ static void unlockOrientation(Screen*);
+
+private:
+ explicit ScreenOrientation(Screen*);
+ static const char* supplementName();
+ Screen* screen() const;
+};
+
+} // namespace WebCore
+
+#endif // ScreenOrientation_h

Powered by Google App Engine
This is Rietveld 408576698