| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 inline InputFieldSpeechButtonElement::InputFieldSpeechButtonElement(Document& do
cument) | 257 inline InputFieldSpeechButtonElement::InputFieldSpeechButtonElement(Document& do
cument) |
| 258 : HTMLDivElement(document) | 258 : HTMLDivElement(document) |
| 259 , m_capturing(false) | 259 , m_capturing(false) |
| 260 , m_state(Idle) | 260 , m_state(Idle) |
| 261 , m_listenerId(0) | 261 , m_listenerId(0) |
| 262 { | 262 { |
| 263 } | 263 } |
| 264 | 264 |
| 265 InputFieldSpeechButtonElement::~InputFieldSpeechButtonElement() | 265 InputFieldSpeechButtonElement::~InputFieldSpeechButtonElement() |
| 266 { | 266 { |
| 267 #if !ENABLE(OILPAN) |
| 267 SpeechInput* speech = speechInput(); | 268 SpeechInput* speech = speechInput(); |
| 268 if (speech && m_listenerId) { // Could be null when page is unloading. | 269 if (speech && m_listenerId) { // Could be null when page is unloading. |
| 269 if (m_state != Idle) | 270 if (m_state != Idle) |
| 270 speech->cancelRecognition(m_listenerId); | 271 speech->cancelRecognition(m_listenerId); |
| 271 speech->unregisterListener(m_listenerId); | 272 speech->unregisterListener(m_listenerId); |
| 272 } | 273 } |
| 274 #endif |
| 273 } | 275 } |
| 274 | 276 |
| 275 PassRefPtr<InputFieldSpeechButtonElement> InputFieldSpeechButtonElement::create(
Document& document) | 277 PassRefPtr<InputFieldSpeechButtonElement> InputFieldSpeechButtonElement::create(
Document& document) |
| 276 { | 278 { |
| 277 RefPtr<InputFieldSpeechButtonElement> element = adoptRef(new InputFieldSpeec
hButtonElement(document)); | 279 RefPtr<InputFieldSpeechButtonElement> element = adoptRef(new InputFieldSpeec
hButtonElement(document)); |
| 278 element->setShadowPseudoId(AtomicString("-webkit-input-speech-button", Atomi
cString::ConstructFromLiteral)); | 280 element->setShadowPseudoId(AtomicString("-webkit-input-speech-button", Atomi
cString::ConstructFromLiteral)); |
| 279 element->setAttribute(idAttr, ShadowElementNames::speechButton()); | 281 element->setAttribute(idAttr, ShadowElementNames::speechButton()); |
| 280 return element.release(); | 282 return element.release(); |
| 281 } | 283 } |
| 282 | 284 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 } | 444 } |
| 443 | 445 |
| 444 void InputFieldSpeechButtonElement::stopSpeechInput() | 446 void InputFieldSpeechButtonElement::stopSpeechInput() |
| 445 { | 447 { |
| 446 if (m_state == Recording) | 448 if (m_state == Recording) |
| 447 speechInput()->stopRecording(m_listenerId); | 449 speechInput()->stopRecording(m_listenerId); |
| 448 } | 450 } |
| 449 #endif // ENABLE(INPUT_SPEECH) | 451 #endif // ENABLE(INPUT_SPEECH) |
| 450 | 452 |
| 451 } | 453 } |
| OLD | NEW |