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_manager.h" | 5 #include "chrome/browser/speech/speech_input_extension_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 | 518 |
519 case kRecording: | 519 case kRecording: |
520 case kStopping: | 520 case kStopping: |
521 *error = kErrorInvalidOperation; | 521 *error = kErrorInvalidOperation; |
522 return false; | 522 return false; |
523 | 523 |
524 default: | 524 default: |
525 NOTREACHED(); | 525 NOTREACHED(); |
526 } | 526 } |
527 | 527 |
528 const extensions::Extension* extension = profile_->GetExtensionService()-> | 528 const extensions::Extension* extension = |
529 GetExtensionById(extension_id, true); | 529 extensions::ExtensionSystem::Get(profile_)->extension_service()-> |
| 530 GetExtensionById(extension_id, true); |
530 DCHECK(extension); | 531 DCHECK(extension); |
531 const std::string& extension_name = extension->name(); | 532 const std::string& extension_name = extension->name(); |
532 | 533 |
533 extension_id_in_use_ = extension_id; | 534 extension_id_in_use_ = extension_id; |
534 VLOG(1) << "State changed to starting"; | 535 VLOG(1) << "State changed to starting"; |
535 state_ = kStarting; | 536 state_ = kStarting; |
536 | 537 |
537 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter = | 538 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter = |
538 profile_->GetRequestContext(); | 539 profile_->GetRequestContext(); |
539 | 540 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 content::NotificationService::current()->Notify( | 751 content::NotificationService::current()->Notify( |
751 chrome::NOTIFICATION_EXTENSION_SPEECH_INPUT_RECORDING_STOPPED, | 752 chrome::NOTIFICATION_EXTENSION_SPEECH_INPUT_RECORDING_STOPPED, |
752 // Guarded by the state_ == kShutdown check. | 753 // Guarded by the state_ == kShutdown check. |
753 content::Source<Profile>(profile_), | 754 content::Source<Profile>(profile_), |
754 content::Details<std::string>(&extension_id)); | 755 content::Details<std::string>(&extension_id)); |
755 } | 756 } |
756 | 757 |
757 void SpeechInputExtensionManager::OnAudioLevelsChange(int session_id, | 758 void SpeechInputExtensionManager::OnAudioLevelsChange(int session_id, |
758 float volume, | 759 float volume, |
759 float noise_volume) {} | 760 float noise_volume) {} |
OLD | NEW |