| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 PassRefPtr<SpeechRecognition> SpeechRecognition::create(ExecutionContext* contex
t) | 41 PassRefPtr<SpeechRecognition> SpeechRecognition::create(ExecutionContext* contex
t) |
| 42 { | 42 { |
| 43 RefPtr<SpeechRecognition> speechRecognition(adoptRef(new SpeechRecognition(c
ontext))); | 43 RefPtr<SpeechRecognition> speechRecognition(adoptRef(new SpeechRecognition(c
ontext))); |
| 44 speechRecognition->suspendIfNeeded(); | 44 speechRecognition->suspendIfNeeded(); |
| 45 return speechRecognition.release(); | 45 return speechRecognition.release(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void SpeechRecognition::start(ExceptionState& es) | 48 void SpeechRecognition::start(ExceptionState& exceptionState) |
| 49 { | 49 { |
| 50 ASSERT(m_controller); | 50 ASSERT(m_controller); |
| 51 if (m_started) { | 51 if (m_started) { |
| 52 es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecu
te("start", "SpeechRecognition", "recognition has already started.")); | 52 exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::f
ailedToExecute("start", "SpeechRecognition", "recognition has already started.")
); |
| 53 return; | 53 return; |
| 54 } | 54 } |
| 55 | 55 |
| 56 setPendingActivity(this); | 56 setPendingActivity(this); |
| 57 m_finalResults.clear(); | 57 m_finalResults.clear(); |
| 58 m_controller->start(this, m_grammars.get(), m_lang, m_continuous, m_interimR
esults, m_maxAlternatives); | 58 m_controller->start(this, m_grammars.get(), m_lang, m_continuous, m_interimR
esults, m_maxAlternatives); |
| 59 m_started = true; | 59 m_started = true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 void SpeechRecognition::stopFunction() | 62 void SpeechRecognition::stopFunction() |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 ASSERT(m_controller); | 184 ASSERT(m_controller); |
| 185 | 185 |
| 186 // FIXME: Need to hook up with Page to get notified when the visibility chan
ges. | 186 // FIXME: Need to hook up with Page to get notified when the visibility chan
ges. |
| 187 } | 187 } |
| 188 | 188 |
| 189 SpeechRecognition::~SpeechRecognition() | 189 SpeechRecognition::~SpeechRecognition() |
| 190 { | 190 { |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace WebCore | 193 } // namespace WebCore |
| OLD | NEW |