OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INPUT_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SPEECH_CHROME_SPEECH_INPUT_MANAGER_H_ |
6 #define CHROME_BROWSER_SPEECH_CHROME_SPEECH_INPUT_MANAGER_H_ | 6 #define CHROME_BROWSER_SPEECH_CHROME_SPEECH_INPUT_MANAGER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "chrome/browser/speech/speech_input_bubble_controller.h" | 10 #include "chrome/browser/speech/speech_input_bubble_controller.h" |
11 #include "content/browser/speech/speech_input_manager.h" | 11 #include "content/browser/speech/speech_input_manager.h" |
12 | 12 |
13 namespace speech_input { | 13 namespace speech_input { |
14 | 14 |
15 // This is Chrome's implementation of the SpeechInputManager interface. This | 15 // This is Chrome's implementation of the SpeechInputManager interface. This |
16 // class is a singleton and accessed via the Get method. | 16 // class is a singleton and accessed via the Get method. |
17 class ChromeSpeechInputManager : public SpeechInputManager, | 17 class ChromeSpeechInputManager : public SpeechInputManager, |
18 public SpeechInputBubbleControllerDelegate { | 18 public SpeechInputBubbleControllerDelegate { |
19 public: | 19 public: |
20 static ChromeSpeechInputManager* GetInstance(); | 20 static ChromeSpeechInputManager* GetInstance(); |
21 | 21 |
22 // SpeechInputBubbleController::Delegate methods. | 22 // SpeechInputBubbleController::Delegate methods. |
23 virtual void InfoBubbleButtonClicked(int caller_id, | 23 virtual void InfoBubbleButtonClicked(int caller_id, |
24 SpeechInputBubble::Button button); | 24 SpeechInputBubble::Button button); |
Satish
2011/10/06 20:30:12
OVERRIDE these as well?
Leandro GraciĆ” Gil
2011/10/06 22:00:28
Done.
| |
25 virtual void InfoBubbleFocusChanged(int caller_id); | 25 virtual void InfoBubbleFocusChanged(int caller_id); |
26 | 26 |
27 protected: | 27 protected: |
28 // SpeechInputManager methods. | 28 // SpeechInputManager methods. |
29 virtual void GetRequestInfo(bool* can_report_metrics, | 29 virtual void GetRequestInfo(bool* can_report_metrics, |
30 std::string* request_info); | 30 std::string* request_info) OVERRIDE; |
31 virtual void ShowRecognitionRequested(int caller_id, | 31 virtual void ShowRecognitionRequested(int caller_id, |
32 int render_process_id, | 32 int render_process_id, |
33 int render_view_id, | 33 int render_view_id, |
34 const gfx::Rect& element_rect); | 34 const gfx::Rect& element_rect) OVERRIDE; |
35 virtual void ShowWarmUp(int caller_id); | 35 virtual void ShowWarmUp(int caller_id) OVERRIDE; |
36 virtual void ShowRecognizing(int caller_id); | 36 virtual void ShowRecognizing(int caller_id) OVERRIDE; |
37 virtual void ShowRecording(int caller_id); | 37 virtual void ShowRecording(int caller_id) OVERRIDE; |
38 virtual void ShowInputVolume(int caller_id, | 38 virtual void ShowInputVolume(int caller_id, |
39 float volume, | 39 float volume, |
40 float noise_volume); | 40 float noise_volume) OVERRIDE; |
41 virtual void ShowNoMicError(int caller_id); | 41 virtual void ShowNoMicError(int caller_id) OVERRIDE; |
42 virtual void ShowRecognizerError(int caller_id, | 42 virtual void ShowRecognizerError(int caller_id, |
43 SpeechRecognizer::ErrorCode error); | 43 SpeechInputError error) OVERRIDE; |
44 virtual void DoClose(int caller_id); | 44 virtual void DoClose(int caller_id) OVERRIDE; |
45 | 45 |
46 private: | 46 private: |
47 class OptionalRequestInfo; | 47 class OptionalRequestInfo; |
48 | 48 |
49 // Private constructor to enforce singleton. | 49 // Private constructor to enforce singleton. |
50 friend struct DefaultSingletonTraits<ChromeSpeechInputManager>; | 50 friend struct DefaultSingletonTraits<ChromeSpeechInputManager>; |
51 ChromeSpeechInputManager(); | 51 ChromeSpeechInputManager(); |
52 virtual ~ChromeSpeechInputManager(); | 52 virtual ~ChromeSpeechInputManager(); |
53 | 53 |
54 scoped_refptr<SpeechInputBubbleController> bubble_controller_; | 54 scoped_refptr<SpeechInputBubbleController> bubble_controller_; |
55 scoped_refptr<OptionalRequestInfo> optional_request_info_; | 55 scoped_refptr<OptionalRequestInfo> optional_request_info_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(ChromeSpeechInputManager); | 57 DISALLOW_COPY_AND_ASSIGN(ChromeSpeechInputManager); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace speech_input | 60 } // namespace speech_input |
61 | 61 |
62 #endif // CHROME_BROWSER_SPEECH_CHROME_SPEECH_INPUT_MANAGER_H_ | 62 #endif // CHROME_BROWSER_SPEECH_CHROME_SPEECH_INPUT_MANAGER_H_ |
OLD | NEW |