| 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 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" | 5 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 // OnAudioEnd can be also raised after an abort, when the bubble has already | 368 // OnAudioEnd can be also raised after an abort, when the bubble has already |
| 369 // been closed. | 369 // been closed. |
| 370 if (GetBubbleController()->GetActiveSessionID() == session_id) { | 370 if (GetBubbleController()->GetActiveSessionID() == session_id) { |
| 371 DCHECK(RequiresBubble(session_id)); | 371 DCHECK(RequiresBubble(session_id)); |
| 372 GetBubbleController()->SetBubbleRecognizingMode(); | 372 GetBubbleController()->SetBubbleRecognizingMode(); |
| 373 } else if (RequiresTrayIcon(session_id)) { | 373 } else if (RequiresTrayIcon(session_id)) { |
| 374 GetTrayIconController()->Hide(); | 374 GetTrayIconController()->Hide(); |
| 375 } | 375 } |
| 376 } | 376 } |
| 377 | 377 |
| 378 void ChromeSpeechRecognitionManagerDelegate::OnRecognitionResult( | 378 void ChromeSpeechRecognitionManagerDelegate::OnRecognitionResults( |
| 379 int session_id, const content::SpeechRecognitionResult& result) { | 379 int session_id, const content::SpeechRecognitionResults& result) { |
| 380 // The bubble will be closed upon the OnEnd event, which will follow soon. | 380 // The bubble will be closed upon the OnEnd event, which will follow soon. |
| 381 } | 381 } |
| 382 | 382 |
| 383 void ChromeSpeechRecognitionManagerDelegate::OnRecognitionError( | 383 void ChromeSpeechRecognitionManagerDelegate::OnRecognitionError( |
| 384 int session_id, const content::SpeechRecognitionError& error) { | 384 int session_id, const content::SpeechRecognitionError& error) { |
| 385 // An error can be dispatched when the bubble is not visible anymore. | 385 // An error can be dispatched when the bubble is not visible anymore. |
| 386 if (GetBubbleController()->GetActiveSessionID() != session_id) | 386 if (GetBubbleController()->GetActiveSessionID() != session_id) |
| 387 return; | 387 return; |
| 388 DCHECK(RequiresBubble(session_id)); | 388 DCHECK(RequiresBubble(session_id)); |
| 389 | 389 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 | 578 |
| 579 SpeechRecognitionTrayIconController* | 579 SpeechRecognitionTrayIconController* |
| 580 ChromeSpeechRecognitionManagerDelegate::GetTrayIconController() { | 580 ChromeSpeechRecognitionManagerDelegate::GetTrayIconController() { |
| 581 if (!tray_icon_controller_.get()) | 581 if (!tray_icon_controller_.get()) |
| 582 tray_icon_controller_ = new SpeechRecognitionTrayIconController(); | 582 tray_icon_controller_ = new SpeechRecognitionTrayIconController(); |
| 583 return tray_icon_controller_.get(); | 583 return tray_icon_controller_.get(); |
| 584 } | 584 } |
| 585 | 585 |
| 586 | 586 |
| 587 } // namespace speech | 587 } // namespace speech |
| OLD | NEW |