| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_VOICE_VOICE_SEARCH_CONTROLLER_IMPL_H_ |
| 6 #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_VOICE_VOICE_SEARCH_CONTROLLER_IMPL_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 |
| 10 @class Tab; |
| 11 @class UIViewController; |
| 12 @protocol VoiceSearchControllerDelegate; |
| 13 |
| 14 // TODO(crbug.com/607204): Convert to Objective-C class. |
| 15 class VoiceSearchController |
| 16 : public base::RefCountedThreadSafe<VoiceSearchController> { |
| 17 public: |
| 18 VoiceSearchController(); |
| 19 |
| 20 // Sets the delegate for this object. |
| 21 virtual void SetDelegate(id<VoiceSearchControllerDelegate> delegate); |
| 22 |
| 23 // Preloads views and view controllers needed for the voice search UI. |
| 24 virtual void PrepareToAppear(); |
| 25 |
| 26 // Starts recognizing and recording process. Will call the delegate method |
| 27 // upon completion if the recognition succeeds. |
| 28 // |presenting_view_controller| is the UIViewController from which to present |
| 29 // the Voice Search input UI. |
| 30 virtual void StartRecognition(UIViewController* presenting_view_controller, |
| 31 Tab* current_tab); |
| 32 |
| 33 // Whether or not the Text To Speech user preference is enabled. |
| 34 virtual bool IsTextToSpeechEnabled(); |
| 35 |
| 36 // Returns whether Text To Speech is supported for the currently selected |
| 37 // Voice Search language. If a Voice Search language has not been specified, |
| 38 // returns whether Text To Speech is supported for the default Voice Search |
| 39 // language. |
| 40 virtual bool IsTextToSpeechSupported(); |
| 41 |
| 42 // Returns |true| if the voice search UI is visible. |
| 43 virtual bool IsVisible(); |
| 44 |
| 45 // Returns |true| if text-to-speech audio is currently playing. |
| 46 virtual bool IsPlayingAudio(); |
| 47 |
| 48 // Dismisses the mic permissions help UI, if shown. |
| 49 virtual void DismissMicPermissionsHelp(); |
| 50 |
| 51 protected: |
| 52 virtual ~VoiceSearchController(); |
| 53 |
| 54 private: |
| 55 friend class base::RefCountedThreadSafe<VoiceSearchController>; |
| 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(VoiceSearchController); |
| 58 }; |
| 59 |
| 60 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_VOICE_VOICE_SEARCH_CONTROLLER_IMPL
_H_ |
| OLD | NEW |