| 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 #ifndef CHROME_BROWSER_SPEECH_SPEECH_INPUT_EXTENSION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SPEECH_SPEECH_INPUT_EXTENSION_MANAGER_H_ | 
| 6 #define CHROME_BROWSER_SPEECH_SPEECH_INPUT_EXTENSION_MANAGER_H_ | 6 #define CHROME_BROWSER_SPEECH_SPEECH_INPUT_EXTENSION_MANAGER_H_ | 
| 7 #pragma once | 7 #pragma once | 
| 8 | 8 | 
| 9 #include <string> | 9 #include <string> | 
| 10 | 10 | 
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" | 
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" | 
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" | 
| 14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" | 
| 15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" | 
| 16 #include "content/public/browser/speech_recognition_event_listener.h" | 16 #include "content/public/browser/speech_recognition_event_listener.h" | 
| 17 | 17 | 
| 18 class Extension; | 18 class Extension; | 
| 19 class Profile; | 19 class Profile; | 
| 20 class SpeechInputExtensionNotification; | 20 class SpeechInputExtensionNotification; | 
| 21 | 21 | 
| 22 namespace content { | 22 namespace content { | 
| 23 class NotificationRegistrar; | 23 class NotificationRegistrar; | 
|  | 24 struct SpeechRecognitionError; | 
|  | 25 struct SpeechRecognitionResult; | 
| 24 class SpeechRecognizer; | 26 class SpeechRecognizer; | 
| 25 } | 27 } | 
| 26 | 28 | 
| 27 namespace net { | 29 namespace net { | 
| 28 class URLRequestContextGetter; | 30 class URLRequestContextGetter; | 
| 29 } | 31 } | 
| 30 | 32 | 
| 31 // Used for API tests. | 33 // Used for API tests. | 
| 32 class SpeechInputExtensionInterface { | 34 class SpeechInputExtensionInterface { | 
| 33  public: | 35  public: | 
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 117   // Methods from SpeechRecognitionEventListener. | 119   // Methods from SpeechRecognitionEventListener. | 
| 118   virtual void OnRecognitionStart(int caller_id) OVERRIDE; | 120   virtual void OnRecognitionStart(int caller_id) OVERRIDE; | 
| 119   virtual void OnAudioStart(int caller_id) OVERRIDE; | 121   virtual void OnAudioStart(int caller_id) OVERRIDE; | 
| 120   virtual void OnEnvironmentEstimationComplete(int caller_id) OVERRIDE; | 122   virtual void OnEnvironmentEstimationComplete(int caller_id) OVERRIDE; | 
| 121   virtual void OnSoundStart(int caller_id) OVERRIDE; | 123   virtual void OnSoundStart(int caller_id) OVERRIDE; | 
| 122   virtual void OnSoundEnd(int caller_id) OVERRIDE; | 124   virtual void OnSoundEnd(int caller_id) OVERRIDE; | 
| 123   virtual void OnAudioEnd(int caller_id) OVERRIDE; | 125   virtual void OnAudioEnd(int caller_id) OVERRIDE; | 
| 124   virtual void OnRecognitionResult( | 126   virtual void OnRecognitionResult( | 
| 125       int caller_id, const content::SpeechRecognitionResult& result) OVERRIDE; | 127       int caller_id, const content::SpeechRecognitionResult& result) OVERRIDE; | 
| 126   virtual void OnRecognitionError( | 128   virtual void OnRecognitionError( | 
| 127       int caller_id, | 129       int caller_id, const content::SpeechRecognitionError& error) OVERRIDE; | 
| 128       const content::SpeechRecognitionErrorCode& error) OVERRIDE; |  | 
| 129   virtual void OnAudioLevelsChange(int caller_id, float volume, | 130   virtual void OnAudioLevelsChange(int caller_id, float volume, | 
| 130                                    float noise_volume) OVERRIDE; | 131                                    float noise_volume) OVERRIDE; | 
| 131   virtual void OnRecognitionEnd(int caller_id) OVERRIDE; | 132   virtual void OnRecognitionEnd(int caller_id) OVERRIDE; | 
| 132 | 133 | 
| 133   // Methods for API testing. | 134   // Methods for API testing. | 
| 134   void SetSpeechInputExtensionInterface( | 135   void SetSpeechInputExtensionInterface( | 
| 135       SpeechInputExtensionInterface* interface); | 136       SpeechInputExtensionInterface* interface); | 
| 136   SpeechInputExtensionInterface* GetSpeechInputExtensionInterface(); | 137   SpeechInputExtensionInterface* GetSpeechInputExtensionInterface(); | 
| 137 | 138 | 
| 138  private: | 139  private: | 
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 196   // Used in the UI thread. | 197   // Used in the UI thread. | 
| 197   scoped_ptr<content::NotificationRegistrar> registrar_; | 198   scoped_ptr<content::NotificationRegistrar> registrar_; | 
| 198   SpeechInputExtensionInterface* speech_interface_; | 199   SpeechInputExtensionInterface* speech_interface_; | 
| 199   scoped_ptr<SpeechInputExtensionNotification> notification_; | 200   scoped_ptr<SpeechInputExtensionNotification> notification_; | 
| 200 | 201 | 
| 201   // Used in the IO thread. | 202   // Used in the IO thread. | 
| 202   scoped_refptr<content::SpeechRecognizer> recognizer_; | 203   scoped_refptr<content::SpeechRecognizer> recognizer_; | 
| 203 }; | 204 }; | 
| 204 | 205 | 
| 205 #endif  // CHROME_BROWSER_SPEECH_SPEECH_INPUT_EXTENSION_MANAGER_H_ | 206 #endif  // CHROME_BROWSER_SPEECH_SPEECH_INPUT_EXTENSION_MANAGER_H_ | 
| OLD | NEW | 
|---|