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

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

Issue 366853008: [screen-orientation] Expose orientation info in OrientationInformation interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 6 years, 6 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/OrientationInformation.h
diff --git a/Source/modules/screen_orientation/OrientationInformation.h b/Source/modules/screen_orientation/OrientationInformation.h
new file mode 100644
index 0000000000000000000000000000000000000000..8275f4d57f8843ec23fd3775613aa62f81f54633
--- /dev/null
+++ b/Source/modules/screen_orientation/OrientationInformation.h
@@ -0,0 +1,47 @@
+// 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.
+
+#ifndef OrientationInformation_h
+#define OrientationInformation_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "public/platform/WebScreenOrientationType.h"
+
+namespace WebCore {
+
+class OrientationInformation FINAL
+ : public GarbageCollectedFinalized<OrientationInformation>
+ , public ScriptWrappable {
+public:
+ // Returns an OrientationInformation instance filed with fake values.
+ static OrientationInformation* createFake();
abarth-chromium 2014/07/02 18:25:09 I wonder if we should pick a slightly different na
mlamouri (slow - plz ping) 2014/07/02 19:18:12 Removed createFake() entirely.
+
+ virtual ~OrientationInformation();
abarth-chromium 2014/07/02 18:25:09 Why does this destructor need to be virtual?
mlamouri (slow - plz ping) 2014/07/02 19:18:11 Removed destructor.
+
+ bool initialized() const;
+
+ String type() const;
+ unsigned short angle() const;
+
+ void trace(Visitor*) { }
+
+protected:
+ friend class ScreenOrientationController;
abarth-chromium 2014/07/02 18:25:10 Please don't use friends. Just expose the functio
mlamouri (slow - plz ping) 2014/07/02 19:18:12 Done.
+
+ OrientationInformation();
+ OrientationInformation(const OrientationInformation&);
abarth-chromium 2014/07/02 18:25:09 It's unusual to have a copy constructor for a DOM
mlamouri (slow - plz ping) 2014/07/02 19:18:11 Done.
+ bool operator==(const OrientationInformation&);
+ bool operator!=(const OrientationInformation&);
abarth-chromium 2014/07/02 18:25:09 These are also unusual. Maybe an |equals| functio
mlamouri (slow - plz ping) 2014/07/02 19:18:12 Done.
+
+ void setType(blink::WebScreenOrientationType);
+ void setAngle(unsigned short);
abarth-chromium 2014/07/02 18:25:09 You can just make these public.
mlamouri (slow - plz ping) 2014/07/02 19:18:11 Done.
+
+private:
+ blink::WebScreenOrientationType m_type;
+ unsigned short m_angle;
+};
+
+} // namespace WebCore
+
+#endif // OrientationInformation_h

Powered by Google App Engine
This is Rietveld 408576698