| 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" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 virtual void GetDiagnosticInformation(bool* can_report_metrics, | 52 virtual void GetDiagnosticInformation(bool* can_report_metrics, |
| 53 std::string* hardware_info) OVERRIDE; | 53 std::string* hardware_info) OVERRIDE; |
| 54 virtual void CheckRecognitionIsAllowed( | 54 virtual void CheckRecognitionIsAllowed( |
| 55 int session_id, | 55 int session_id, |
| 56 base::Callback<void(int session_id, bool is_allowed)> callback) OVERRIDE; | 56 base::Callback<void(int session_id, bool is_allowed)> callback) OVERRIDE; |
| 57 virtual content::SpeechRecognitionEventListener* GetEventListener() OVERRIDE; | 57 virtual content::SpeechRecognitionEventListener* GetEventListener() OVERRIDE; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 class OptionalRequestInfo; | 60 class OptionalRequestInfo; |
| 61 | 61 |
| 62 // Shows the recognition tray icon for a given |context_name|, eventually |
| 63 // with a notification balloon. The balloon is shown only once per profile |
| 64 // for a given context_name. |render_process_id| is required to lookup the |
| 65 // profile associated with the renderer that initiated the recognition. |
| 66 static void ShowTrayIconOnUIThread( |
| 67 const std::string& context_name, |
| 68 int render_process_id, |
| 69 scoped_refptr<SpeechRecognitionTrayIconController> tray_icon_controller); |
| 70 |
| 62 // Checks for VIEW_TYPE_TAB_CONTENTS host in the UI thread and notifies back | 71 // Checks for VIEW_TYPE_TAB_CONTENTS host in the UI thread and notifies back |
| 63 // the result in the IO thread through |callback|. | 72 // the result in the IO thread through |callback|. |
| 64 static void CheckRenderViewType( | 73 static void CheckRenderViewType( |
| 65 int session_id, | 74 int session_id, |
| 66 base::Callback<void(int session_id, bool is_allowed)> callback, | 75 base::Callback<void(int session_id, bool is_allowed)> callback, |
| 67 int render_process_id, | 76 int render_process_id, |
| 68 int render_view_id); | 77 int render_view_id); |
| 69 | 78 |
| 70 // Starts a new recognition session, using the config of the last one | 79 // Starts a new recognition session, using the config of the last one |
| 71 // (which is copied into |last_session_config_|). Used for "try again". | 80 // (which is copied into |last_session_config_|). Used for "try again". |
| (...skipping 10 matching lines...) Expand all Loading... |
| 82 | 91 |
| 83 // TODO(primiano) this information should be kept into the bubble_controller_. | 92 // TODO(primiano) this information should be kept into the bubble_controller_. |
| 84 int active_bubble_session_id_; | 93 int active_bubble_session_id_; |
| 85 | 94 |
| 86 DISALLOW_COPY_AND_ASSIGN(ChromeSpeechRecognitionManagerDelegate); | 95 DISALLOW_COPY_AND_ASSIGN(ChromeSpeechRecognitionManagerDelegate); |
| 87 }; | 96 }; |
| 88 | 97 |
| 89 } // namespace speech | 98 } // namespace speech |
| 90 | 99 |
| 91 #endif // CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ | 100 #endif // CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ |
| OLD | NEW |