Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: chrome/browser/speech/speech_input_extension_api.cc

Issue 10694106: Added support for multiple parameters to Extension API callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Synced. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 SpeechInputExtensionManager::kStopping, 159 SpeechInputExtensionManager::kStopping,
160 SpeechInputExtensionManager::kIdle, 160 SpeechInputExtensionManager::kIdle,
161 chrome::NOTIFICATION_EXTENSION_SPEECH_INPUT_RECORDING_STOPPED) { 161 chrome::NOTIFICATION_EXTENSION_SPEECH_INPUT_RECORDING_STOPPED) {
162 } 162 }
163 163
164 bool StopSpeechInputFunction::RunImpl() { 164 bool StopSpeechInputFunction::RunImpl() {
165 return SpeechInputExtensionManager::GetForProfile( 165 return SpeechInputExtensionManager::GetForProfile(
166 profile())->Stop(extension_id(), &error_); 166 profile())->Stop(extension_id(), &error_);
167 } 167 }
168 168
169 void IsRecordingSpeechInputFunction::SetResult(bool result) { 169 void IsRecordingSpeechInputFunction::SetIsRecordingResult(bool result) {
170 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 170 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
171 result_.reset(Value::CreateBooleanValue(result)); 171 SetResult(Value::CreateBooleanValue(result));
172 SendResponse(true); 172 SendResponse(true);
173 } 173 }
174 174
175 void IsRecordingSpeechInputFunction::Run() { 175 void IsRecordingSpeechInputFunction::Run() {
176 SpeechInputExtensionManager::GetForProfile(profile())->IsRecording( 176 SpeechInputExtensionManager::GetForProfile(profile())->IsRecording(
177 base::Bind(&IsRecordingSpeechInputFunction::SetResult, this)); 177 base::Bind(&IsRecordingSpeechInputFunction::SetIsRecordingResult, this));
178 } 178 }
179 179
180 bool IsRecordingSpeechInputFunction::RunImpl() { 180 bool IsRecordingSpeechInputFunction::RunImpl() {
181 // The operation needs to be asynchronous because of thread requirements. 181 // The operation needs to be asynchronous because of thread requirements.
182 // This method does nothing, but it needs to be implemented anyway. 182 // This method does nothing, but it needs to be implemented anyway.
183 return true; 183 return true;
184 } 184 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698