| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/extensions/extension_speech_input_api.h" | |
| 6 | |
| 7 #include "base/values.h" | |
| 8 #include "chrome/browser/extensions/extension_speech_input_manager.h" | |
| 9 #include "chrome/browser/profiles/profile.h" | |
| 10 | |
| 11 SpeechInputAsyncFunction::SpeechInputAsyncFunction() { | |
| 12 } | |
| 13 | |
| 14 void SpeechInputAsyncFunction::Run() { | |
| 15 | |
| 16 // TODO(leandrogracia): implement the management of the asynchronous | |
| 17 // operations involved and the corresponding state transitions. | |
| 18 RunImpl(); | |
| 19 | |
| 20 SendResponse(true); | |
| 21 } | |
| 22 | |
| 23 void SpeechInputAsyncFunction::Observe(int type, | |
| 24 const NotificationSource& source, | |
| 25 const NotificationDetails& details) { | |
| 26 // TODO(leandrogracia): to be implemented. | |
| 27 } | |
| 28 | |
| 29 bool StartSpeechInputFunction::RunImpl() { | |
| 30 ExtensionSpeechInputManager::GetForProfile(profile())->Start(GetExtension()); | |
| 31 return true; | |
| 32 } | |
| 33 | |
| 34 bool StopSpeechInputFunction::RunImpl() { | |
| 35 ExtensionSpeechInputManager::GetForProfile(profile())->Stop(GetExtension()); | |
| 36 return true; | |
| 37 } | |
| 38 | |
| 39 bool IsRecordingSpeechInputFunction::RunImpl() { | |
| 40 // TODO(leandrogracia): to be implemented. | |
| 41 result_.reset(Value::CreateBooleanValue(false)); | |
| 42 return true; | |
| 43 } | |
| OLD | NEW |