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_CHROME_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ |
6 #define CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ | 6 #define CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "chrome/browser/speech/speech_recognition_bubble_controller.h" | 11 #include "chrome/browser/speech/speech_recognition_bubble_controller.h" |
12 #include "content/public/browser/speech_recognition_event_listener.h" | 12 #include "content/public/browser/speech_recognition_event_listener.h" |
13 #include "content/public/browser/speech_recognition_manager_delegate.h" | 13 #include "content/public/browser/speech_recognition_manager_delegate.h" |
14 #include "content/public/browser/speech_recognition_session_config.h" | 14 #include "content/public/browser/speech_recognition_session_config.h" |
15 | 15 |
16 class SpeechRecognitionTrayIconController; | |
17 | |
16 namespace speech { | 18 namespace speech { |
17 | 19 |
18 // This is Chrome's implementation of the SpeechRecognitionManagerDelegate | 20 // This is Chrome's implementation of the SpeechRecognitionManagerDelegate |
19 // interface. | 21 // interface. |
20 class ChromeSpeechRecognitionManagerDelegate | 22 class ChromeSpeechRecognitionManagerDelegate |
21 : NON_EXPORTED_BASE(public content::SpeechRecognitionManagerDelegate), | 23 : NON_EXPORTED_BASE(public content::SpeechRecognitionManagerDelegate), |
22 public content::SpeechRecognitionEventListener, | 24 public content::SpeechRecognitionEventListener, |
23 public SpeechRecognitionBubbleControllerDelegate { | 25 public SpeechRecognitionBubbleControllerDelegate { |
24 public: | 26 public: |
25 ChromeSpeechRecognitionManagerDelegate(); | 27 ChromeSpeechRecognitionManagerDelegate(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 static void CheckRenderViewType( | 64 static void CheckRenderViewType( |
63 int session_id, | 65 int session_id, |
64 base::Callback<void(int session_id, bool is_allowed)> callback, | 66 base::Callback<void(int session_id, bool is_allowed)> callback, |
65 int render_process_id, | 67 int render_process_id, |
66 int render_view_id); | 68 int render_view_id); |
67 | 69 |
68 // Starts a new recognition session, using the config of the last one | 70 // Starts a new recognition session, using the config of the last one |
69 // (which is copied into |last_session_config_|). Used for "try again". | 71 // (which is copied into |last_session_config_|). Used for "try again". |
70 void RestartLastSession(); | 72 void RestartLastSession(); |
71 | 73 |
74 // Lazy initializers for bubble and tray icon controller. | |
75 SpeechRecognitionBubbleController* BubbleController(); | |
Satish
2012/05/20 21:40:26
I'd suggest naming these as
GetBubbleController(
Primiano Tucci (use gerrit)
2012/05/21 16:03:13
Done.
| |
76 SpeechRecognitionTrayIconController* TrayIconController(); | |
77 | |
72 scoped_refptr<SpeechRecognitionBubbleController> bubble_controller_; | 78 scoped_refptr<SpeechRecognitionBubbleController> bubble_controller_; |
79 scoped_refptr<SpeechRecognitionTrayIconController> tray_icon_controller_; | |
73 scoped_refptr<OptionalRequestInfo> optional_request_info_; | 80 scoped_refptr<OptionalRequestInfo> optional_request_info_; |
74 scoped_ptr<content::SpeechRecognitionSessionConfig> last_session_config_; | 81 scoped_ptr<content::SpeechRecognitionSessionConfig> last_session_config_; |
75 | 82 |
76 // TODO(primiano) this information should be kept into the bubble_controller_. | 83 // TODO(primiano) this information should be kept into the bubble_controller_. |
77 int active_bubble_session_id_; | 84 int active_bubble_session_id_; |
78 | 85 |
79 DISALLOW_COPY_AND_ASSIGN(ChromeSpeechRecognitionManagerDelegate); | 86 DISALLOW_COPY_AND_ASSIGN(ChromeSpeechRecognitionManagerDelegate); |
80 }; | 87 }; |
81 | 88 |
82 } // namespace speech | 89 } // namespace speech |
83 | 90 |
84 #endif // CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ | 91 #endif // CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ |
OLD | NEW |