OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/speech/speech_input_extension_api.h" | 5 #include "chrome/browser/speech/speech_input_extension_api.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 : start_state_(start_state), | 35 : start_state_(start_state), |
36 transition_state_(transition_state), | 36 transition_state_(transition_state), |
37 end_state_(end_state), | 37 end_state_(end_state), |
38 transition_notification_(transition_notification), | 38 transition_notification_(transition_notification), |
39 expecting_transition_(false), | 39 expecting_transition_(false), |
40 failed_(false) { | 40 failed_(false) { |
41 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_SPEECH_INPUT_FAILED, | 41 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_SPEECH_INPUT_FAILED, |
42 content::Source<Profile>(profile())); | 42 content::Source<Profile>(profile())); |
43 } | 43 } |
44 | 44 |
45 SpeechInputAsyncFunction::~SpeechInputAsyncFunction() { | 45 SpeechInputAsyncFunction::~SpeechInputAsyncFunction() {} |
46 } | |
47 | 46 |
48 void SpeechInputAsyncFunction::Run() { | 47 void SpeechInputAsyncFunction::Run() { |
49 if (failed_) { | 48 if (failed_) { |
50 registrar_.RemoveAll(); | 49 registrar_.RemoveAll(); |
51 SendResponse(false); | 50 SendResponse(false); |
52 return; | 51 return; |
53 } | 52 } |
54 | 53 |
55 SpeechInputExtensionManager::State state = | 54 SpeechInputExtensionManager::State state = |
56 SpeechInputExtensionManager::GetForProfile(profile())->state(); | 55 SpeechInputExtensionManager::GetForProfile(profile())->state(); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 void IsRecordingSpeechInputFunction::Run() { | 175 void IsRecordingSpeechInputFunction::Run() { |
177 SpeechInputExtensionManager::GetForProfile(profile())->IsRecording( | 176 SpeechInputExtensionManager::GetForProfile(profile())->IsRecording( |
178 base::Bind(&IsRecordingSpeechInputFunction::SetResult, this)); | 177 base::Bind(&IsRecordingSpeechInputFunction::SetResult, this)); |
179 } | 178 } |
180 | 179 |
181 bool IsRecordingSpeechInputFunction::RunImpl() { | 180 bool IsRecordingSpeechInputFunction::RunImpl() { |
182 // The operation needs to be asynchronous because of thread requirements. | 181 // The operation needs to be asynchronous because of thread requirements. |
183 // This method does nothing, but it needs to be implemented anyway. | 182 // This method does nothing, but it needs to be implemented anyway. |
184 return true; | 183 return true; |
185 } | 184 } |
OLD | NEW |