Index: Source/modules/devicelight/DeviceLightEvent.cpp |
diff --git a/Source/modules/speech/SpeechGrammar.cpp b/Source/modules/devicelight/DeviceLightEvent.cpp |
similarity index 64% |
copy from Source/modules/speech/SpeechGrammar.cpp |
copy to Source/modules/devicelight/DeviceLightEvent.cpp |
index 9a8ad3a5166f855d83a794d6b7e1f4c6ddb4e3f3..7a4dd9c4b4740f44ebb96029419e3114272bf4eb 100644 |
--- a/Source/modules/speech/SpeechGrammar.cpp |
+++ b/Source/modules/devicelight/DeviceLightEvent.cpp |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2012 Google Inc. All rights reserved. |
+ * Copyright (C) 2014 Intel Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
@@ -25,39 +25,46 @@ |
#include "config.h" |
-#include "modules/speech/SpeechGrammar.h" |
- |
-#include "core/dom/Document.h" |
+#include "modules/devicelight/DeviceLightEvent.h" |
namespace WebCore { |
-PassRefPtrWillBeRawPtr<SpeechGrammar> SpeechGrammar::create() |
+DeviceLightEvent::~DeviceLightEvent() |
{ |
- return adoptRefWillBeNoop(new SpeechGrammar); |
} |
-PassRefPtrWillBeRawPtr<SpeechGrammar> SpeechGrammar::create(const KURL& src, double weight) |
+DeviceLightEvent::DeviceLightEvent() |
+ : m_value(std::numeric_limits<double>::infinity()) |
{ |
- return adoptRefWillBeNoop(new SpeechGrammar(src, weight)); |
+ ScriptWrappable::init(this); |
} |
-void SpeechGrammar::setSrc(ExecutionContext* executionContext, const String& src) |
+DeviceLightEvent::DeviceLightEvent(const AtomicString& eventType, const double value) |
+ : Event(eventType, true, false) // Default event is bubbles, not cancellable. |
+ , m_value(value) |
{ |
- Document* document = toDocument(executionContext); |
- m_src = document->completeURL(src); |
+ ScriptWrappable::init(this); |
} |
-SpeechGrammar::SpeechGrammar() |
- : m_weight(1.0) |
+DeviceLightEvent::DeviceLightEvent(const AtomicString& eventType, const DeviceLightEventInit& initializer) |
+ : Event(eventType, initializer) |
+ , m_value(initializer.value) |
{ |
ScriptWrappable::init(this); |
} |
-SpeechGrammar::SpeechGrammar(const KURL& src, double weight) |
- : m_src(src) |
- , m_weight(weight) |
+const AtomicString& DeviceLightEvent::interfaceName() const |
{ |
- ScriptWrappable::init(this); |
+ return EventNames::DeviceLightEvent; |
+} |
+ |
+void DeviceLightEvent::trace(Visitor* visitor) |
+{ |
+ Event::trace(visitor); |
} |
} // namespace WebCore |
+ |
+ |
+ |
+ |