Commit d700b9d7 authored by peter@chromium.org's avatar peter@chromium.org

Revert of Move testRunner.startSpeechInput/setValueForUser to internals...

Revert of Move testRunner.startSpeechInput/setValueForUser to internals (https://codereview.chromium.org/176953009/)

Reason for revert:
Broke the Android compile:
  http://build.chromium.org/p/chromium.webkit/builders/Android%20Builder%20%28dbg%29/builds/25493/steps/compile/logs/stdio

Android does not enable speech input, and the methods called are guarded behind the ENABLE_INPUT_SPEECH compile-time flag. The testing code in Internals.cpp should also be guarded with the same flag.

Original issue's description:
> Move testRunner.startSpeechInput/setValueForUser to internals
> 
> Now TestRunner is being moved from CppBoundClass to gin::Wrappable,
> where it is not appropriate to use WebElements directly. This CL moves
> some functions which treats WebElement* from testRunner to internals.
> (To be exact, this CL only copies some functions, but I'll remove those ones
> in testRunner later.)
> 
> BUG=331301
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168495

TBR=haraken@chromium.org,hajimehoshi@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=331301

Review URL: https://codereview.chromium.org/187903004

git-svn-id: svn://svn.chromium.org/blink/trunk@168498 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e754b45b
......@@ -15,8 +15,8 @@
}
tf.focus();
if (window.internals) {
internals.setValueForUser(tf, 'Hello!');
if (window.testRunner) {
testRunner.setValueForUser(tf, 'Hello!');
}
// Should not fire the event until focus is lost.
......
......@@ -14,7 +14,7 @@ function startSpeechInput(id) {
// will be set in input during the generated TextInput event.
var input = document.getElementById(id);
input.select();
internals.startSpeechInput(input);
testRunner.startSpeechInput(input);
}
function onWebkitSpeechChange() {
......
......@@ -89,8 +89,6 @@
#include "core/html/HTMLTextAreaElement.h"
#include "core/html/forms/FormController.h"
#include "core/html/shadow/HTMLContentElement.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"
......@@ -2389,20 +2387,4 @@ void Internals::trace(Visitor* visitor)
visitor->trace(m_profilers);
}
void Internals::startSpeechInput(Element* element)
{
HTMLInputElement* input = toHTMLInputElement(element);
if (!input->isSpeechEnabled())
return;
InputFieldSpeechButtonElement* speechButton = toInputFieldSpeechButtonElement(input->userAgentShadowRoot()->getElementById(ShadowElementNames::speechButton()));
if (speechButton)
speechButton->startSpeechInput();
}
void Internals::setValueForUser(Element* element, const String& value)
{
toHTMLInputElement(element)->setValueForUser(value);
}
}
......@@ -314,9 +314,6 @@ public:
void trace(Visitor*);
void startSpeechInput(Element*);
void setValueForUser(Element*, const String&);
private:
explicit Internals(Document*);
Document* contextDocument() const;
......
......@@ -279,7 +279,4 @@
[RaisesException] void setShouldRevealPassword(Element element, boolean reveal);
[CallWith=ExecutionContext] Promise addOneToPromise(Promise promise);
void startSpeechInput(Element element);
void setValueForUser(Element element, DOMString value);
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment