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

Side by Side Diff: Source/modules/presentation/Presentation.cpp

Issue 408663002: Add the Presentation API module and a single event target (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Made navigator.presentation an event target for onavailablechange (no implementation yet). 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 unified diff | Download patch
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/presentation/Presentation.h"
7
8 #include "core/dom/Document.h"
9 #include "core/frame/LocalFrame.h"
10 #include "modules/EventTargetModules.h"
11
12 namespace blink {
13
14 Presentation::Presentation(LocalFrame* frame)
15 : DOMWindowProperty(frame)
16 {
17 ScriptWrappable::init(this);
18 }
19
20 Presentation::~Presentation()
21 {
22 }
23
24 // static
25 Presentation* Presentation::create(LocalFrame* frame)
26 {
27 return new Presentation(frame);
28 }
29
30 bool Presentation::displayAvailable() const
31 {
32 return true;
33 }
34
35 const WTF::AtomicString& Presentation::interfaceName() const
36 {
37 return EventTargetNames::Presentation;
38 }
39
40 ExecutionContext* Presentation::executionContext() const
41 {
42 if (!frame())
43 return 0;
44 return frame()->document();
45 }
46
47 void Presentation::trace(Visitor* visitor)
48 {
49 EventTargetWithInlineData::trace(visitor);
50 }
51
52 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698