| Index: chrome/browser/speech/speech_recognition_bubble_controller.h
|
| diff --git a/chrome/browser/speech/speech_recognition_bubble_controller.h b/chrome/browser/speech/speech_recognition_bubble_controller.h
|
| index c7bac9e3be7f3566826b35b814921385d0ee96b4..238df9e51a3fbdf1a621a9f5b98d76587326f948 100644
|
| --- a/chrome/browser/speech/speech_recognition_bubble_controller.h
|
| +++ b/chrome/browser/speech/speech_recognition_bubble_controller.h
|
| @@ -34,6 +34,19 @@ class SpeechRecognitionBubbleController
|
| virtual ~Delegate() {}
|
| };
|
|
|
| + // All methods of this delegate are called on the UI thread.
|
| + class DelegateForTests {
|
| + public:
|
| + virtual void BubbleCreated() = 0;
|
| + virtual void BubbleSwitchedToRecordingMode() = 0;
|
| + virtual void BubbleSwitchedToRecognizingMode() = 0;
|
| + virtual void BubbleMessageDisplayed() = 0;
|
| + virtual void BubbleClosed() = 0;
|
| + };
|
| +
|
| + static void SetDelegateForTests(DelegateForTests* delegate_for_tests);
|
| + static SpeechRecognitionBubbleController* GetInstanceForTests();
|
| +
|
| explicit SpeechRecognitionBubbleController(Delegate* delegate);
|
|
|
| // Creates and shows a new speech recognition UI bubble in warmup mode.
|
| @@ -104,6 +117,12 @@ class SpeechRecognitionBubbleController
|
| void InvokeDelegateFocusChanged();
|
| void ProcessRequestInUiThread(const UIRequest& request);
|
|
|
| + // Instance getter for simulating button presses during tests.
|
| + static SpeechRecognitionBubbleController* instance_for_tests_;
|
| +
|
| + // Delegate for receiving events on the UI thread during tests.
|
| + static DelegateForTests* delegate_for_tests_;
|
| +
|
| // *** The following are accessed only on the IO thread.
|
| Delegate* delegate_;
|
|
|
| @@ -127,6 +146,9 @@ class SpeechRecognitionBubbleController
|
| typedef SpeechRecognitionBubbleController::Delegate
|
| SpeechRecognitionBubbleControllerDelegate;
|
|
|
| +typedef SpeechRecognitionBubbleController::DelegateForTests
|
| + SpeechRecognitionBubbleControllerDelegateForTests;
|
| +
|
| } // namespace speech
|
|
|
| #endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_BUBBLE_CONTROLLER_H_
|
|
|