Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / screen_orientation / ScreenOrientationController.h
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ScreenOrientationController_h
6 #define ScreenOrientationController_h
7
8 #include "core/dom/DocumentSupplementable.h"
9 #include "public/platform/WebScreenOrientationType.h"
10
11 namespace WebCore {
12
13 class ScreenOrientationController FINAL : public NoBaseWillBeGarbageCollected<ScreenOrientationController>, public DocumentSupplement {
14     WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController);
15 public:
16 #if !ENABLE(OILPAN)
17     virtual ~ScreenOrientationController();
18 #endif
19
20     void didChangeScreenOrientation(blink::WebScreenOrientationType);
21
22     blink::WebScreenOrientationType orientation() const { return m_orientation; }
23
24     // DocumentSupplement API.
25     static ScreenOrientationController& from(Document&);
26     static const char* supplementName();
27
28 private:
29     explicit ScreenOrientationController(Document&);
30
31     void dispatchOrientationChangeEvent();
32
33     Document& m_document;
34     blink::WebScreenOrientationType m_orientation;
35 };
36
37 } // namespace WebCore
38
39 #endif // ScreenOrientationController_h