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

Unified Diff: Source/core/css/MediaQueryListEvent.h

Issue 404563003: Add MediaQueryListEvent. Not used yet. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: also need webexposed/global-constructors-listing-expected.txt 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/MediaQueryListEvent.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaQueryListEvent.h
diff --git a/Source/core/css/MediaQueryListEvent.h b/Source/core/css/MediaQueryListEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..48b9370a8b4d8dbe1324a9c0e6112cfc8e32324b
--- /dev/null
+++ b/Source/core/css/MediaQueryListEvent.h
@@ -0,0 +1,71 @@
+// 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 MediaQueryListEvent_h
+#define MediaQueryListEvent_h
+
+#include "core/events/Event.h"
+
+namespace WebCore {
+
+struct MediaQueryListEventInit : public EventInit {
+ MediaQueryListEventInit() : matches(false) { }
+
+ String media;
+ bool matches;
+};
+
+class MediaQueryListEvent FINAL : public Event {
+public:
+ static PassRefPtrWillBeRawPtr<MediaQueryListEvent> create()
+ {
+ return adoptRefWillBeNoop(new MediaQueryListEvent);
+ }
+
+ static PassRefPtrWillBeRawPtr<MediaQueryListEvent> create(const String& media, bool matches)
+ {
+ return adoptRefWillBeNoop(new MediaQueryListEvent(media, matches));
+ }
+
+ static PassRefPtrWillBeRawPtr<MediaQueryListEvent> create(const AtomicString& eventType, const MediaQueryListEventInit& initializer)
+ {
+ return adoptRefWillBeNoop(new MediaQueryListEvent(eventType, initializer));
+ }
+
+ const String& media() const { return m_media; }
+ bool matches() const { return m_matches; }
+
+ virtual const AtomicString& interfaceName() const OVERRIDE { return EventNames::MediaQueryListEvent; }
+
+ virtual void trace(Visitor* visitor) OVERRIDE { Event::trace(visitor); }
+
+private:
+ MediaQueryListEvent()
+ {
+ ScriptWrappable::init(this);
+ }
+
+ MediaQueryListEvent(const String& media, bool matches)
+ : Event(EventTypeNames::change, false, false)
+ , m_media(media)
+ , m_matches(matches)
+ {
+ ScriptWrappable::init(this);
+ }
+
+ MediaQueryListEvent(const AtomicString& eventType, const MediaQueryListEventInit& initializer)
+ : Event(eventType, initializer)
+ , m_media(initializer.media)
+ , m_matches(initializer.matches)
+ {
+ ScriptWrappable::init(this);
+ }
+
+ String m_media;
+ bool m_matches;
+};
+
+} // namespace WebCore
+
+#endif // MediaQueryListEvent_h
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/MediaQueryListEvent.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698