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

Unified Diff: Source/core/testing/Internals.cpp

Issue 176953009: Move testRunner.startSpeechInput/setValueForUser to internals (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: (rebasing) Created 6 years, 9 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/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index 57b11996584feec20b088f293fdd187282992f79..9b210482b4f6fbfc18df79c5dcd0ed998028c49f 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -89,6 +89,8 @@
#include "core/html/HTMLSelectElement.h"
#include "core/html/HTMLTextAreaElement.h"
#include "core/html/forms/FormController.h"
+#include "core/html/shadow/ShadowElementNames.h"
+#include "core/html/shadow/TextControlInnerElements.h"
#include "core/inspector/InspectorClient.h"
#include "core/inspector/InspectorConsoleAgent.h"
#include "core/inspector/InspectorController.h"
@@ -2387,4 +2389,22 @@ void Internals::trace(Visitor* visitor)
visitor->trace(m_profilers);
}
+void Internals::startSpeechInput(Element* element)
+{
+#if ENABLE(INPUT_SPEECH)
+ HTMLInputElement* input = toHTMLInputElement(element);
+ if (!input->isSpeechEnabled())
+ return;
+
+ InputFieldSpeechButtonElement* speechButton = toInputFieldSpeechButtonElement(input->userAgentShadowRoot()->getElementById(ShadowElementNames::speechButton()));
+ if (speechButton)
+ speechButton->startSpeechInput();
+#endif
+}
+
+void Internals::setValueForUser(Element* element, const String& value)
+{
+ toHTMLInputElement(element)->setValueForUser(value);
+}
+
}
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698