| 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 CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/public/browser/browser_message_filter.h" | 13 #include "content/public/browser/browser_message_filter.h" |
| 14 #include "content/public/browser/speech_recognition_event_listener.h" | 14 #include "content/public/browser/speech_recognition_event_listener.h" |
| 15 #include "net/url_request/url_request_context_getter.h" | 15 #include "net/url_request/url_request_context_getter.h" |
| 16 | 16 |
| 17 struct SpeechRecognitionHostMsg_StartRequest_Params; | 17 struct SpeechRecognitionHostMsg_StartRequest_Params; |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 class SpeechRecognitionManager; | 21 class SpeechRecognitionManager; |
| 22 struct SpeechRecognitionResult; | |
| 23 | 22 |
| 24 // SpeechRecognitionDispatcherHost is a delegate for Speech API messages used by | 23 // SpeechRecognitionDispatcherHost is a delegate for Speech API messages used by |
| 25 // RenderMessageFilter. Basically it acts as a proxy, relaying the events coming | 24 // RenderMessageFilter. Basically it acts as a proxy, relaying the events coming |
| 26 // from the SpeechRecognitionManager to IPC messages (and vice versa). | 25 // from the SpeechRecognitionManager to IPC messages (and vice versa). |
| 27 // It's the complement of SpeechRecognitionDispatcher (owned by RenderView). | 26 // It's the complement of SpeechRecognitionDispatcher (owned by RenderView). |
| 28 class CONTENT_EXPORT SpeechRecognitionDispatcherHost | 27 class CONTENT_EXPORT SpeechRecognitionDispatcherHost |
| 29 : public BrowserMessageFilter, | 28 : public BrowserMessageFilter, |
| 30 public SpeechRecognitionEventListener { | 29 public SpeechRecognitionEventListener { |
| 31 public: | 30 public: |
| 32 SpeechRecognitionDispatcherHost( | 31 SpeechRecognitionDispatcherHost( |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // about this class being destroyed in the meanwhile (due to browser shutdown) | 83 // about this class being destroyed in the meanwhile (due to browser shutdown) |
| 85 // since tasks pending on a destroyed WeakPtr are automatically discarded. | 84 // since tasks pending on a destroyed WeakPtr are automatically discarded. |
| 86 base::WeakPtrFactory<SpeechRecognitionDispatcherHost> weak_factory_; | 85 base::WeakPtrFactory<SpeechRecognitionDispatcherHost> weak_factory_; |
| 87 | 86 |
| 88 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionDispatcherHost); | 87 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionDispatcherHost); |
| 89 }; | 88 }; |
| 90 | 89 |
| 91 } // namespace content | 90 } // namespace content |
| 92 | 91 |
| 93 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ | 92 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_DISPATCHER_HOST_H_ |
| OLD | NEW |