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

Side by Side Diff: Source/modules/screen_orientation/ScreenOrientation.cpp

Issue 168763002: Add initial Screen Orientation API support: IDL changes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix remaining nits 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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 #include "config.h"
6 #include "modules/screen_orientation/ScreenOrientation.h"
7
8 #include "core/frame/DOMWindow.h"
9 #include "core/frame/Frame.h"
10 #include "core/frame/Screen.h"
11
12 namespace WebCore {
13
14 ScreenOrientation::ScreenOrientation(Screen* screen)
15 : DOMWindowProperty(screen->frame())
16 {
17 }
18
19 const char* ScreenOrientation::supplementName()
20 {
21 return "ScreenOrientation";
22 }
23
24 ScreenOrientation* ScreenOrientation::from(Screen* screen)
25 {
26 ScreenOrientation* supplement = static_cast<ScreenOrientation*>(Supplement<S creen>::from(screen, supplementName()));
27 if (!supplement) {
28 ASSERT(screen);
29 supplement = new ScreenOrientation(screen);
30 provideTo(screen, supplementName(), adoptPtr(supplement));
31 }
32 return supplement;
33 }
34
35 ScreenOrientation::~ScreenOrientation()
36 {
37 }
38
39 Screen* ScreenOrientation::screen() const
40 {
41 Frame* frame = this->frame();
42 ASSERT(frame);
43 DOMWindow* window = frame->domWindow();
44 ASSERT(window);
45 return window->screen();
46 }
47
48 const AtomicString& ScreenOrientation::orientation(Screen* screen)
49 {
50 // FIXME: Implement.
51 DEFINE_STATIC_LOCAL(const AtomicString, portraitPrimary, ("portrait-primary" , AtomicString::ConstructFromLiteral));
52 return portraitPrimary;
53 }
54
55 bool ScreenOrientation::lockOrientation(Screen* screen, const Vector<String>& or ientations)
56 {
57 // FIXME: Implement.
58 return false;
59 }
60
61 bool ScreenOrientation::lockOrientation(Screen* screen, const AtomicString& orie ntation)
62 {
63 // FIXME: Implement.
64 return false;
65 }
66
67 void ScreenOrientation::unlockOrientation(Screen* screen)
68 {
69 // FIXME: Implement.
70 }
71
72 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/screen_orientation/ScreenOrientation.h ('k') | Source/modules/screen_orientation/ScreenOrientation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698