Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: ios/public/provider/chrome/browser/voice/voice_search_controller.h

Issue 2453003002: [ios] Adds a VoiceSearchController interface to the provider layer. (Closed)
Patch Set: Rebased. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/public/provider/chrome/browser/voice/voice_search_controller.h
diff --git a/ios/public/provider/chrome/browser/voice/voice_search_controller.h b/ios/public/provider/chrome/browser/voice/voice_search_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..e2dfb0b68db7e42ee19648b7f8e1cdec8403df1f
--- /dev/null
+++ b/ios/public/provider/chrome/browser/voice/voice_search_controller.h
@@ -0,0 +1,60 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_VOICE_VOICE_SEARCH_CONTROLLER_IMPL_H_
+#define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_VOICE_VOICE_SEARCH_CONTROLLER_IMPL_H_
+
+#include "base/memory/ref_counted.h"
+
+@class Tab;
+@class UIViewController;
+@protocol VoiceSearchControllerDelegate;
+
+// TODO(crbug.com/607204): Convert to Objective-C class.
+class VoiceSearchController
+ : public base::RefCountedThreadSafe<VoiceSearchController> {
+ public:
+ VoiceSearchController();
+
+ // Sets the delegate for this object.
+ virtual void SetDelegate(id<VoiceSearchControllerDelegate> delegate);
+
+ // Preloads views and view controllers needed for the voice search UI.
+ virtual void PrepareToAppear();
+
+ // Starts recognizing and recording process. Will call the delegate method
+ // upon completion if the recognition succeeds.
+ // |presenting_view_controller| is the UIViewController from which to present
+ // the Voice Search input UI.
+ virtual void StartRecognition(UIViewController* presenting_view_controller,
+ Tab* current_tab);
+
+ // Whether or not the Text To Speech user preference is enabled.
+ virtual bool IsTextToSpeechEnabled();
+
+ // Returns whether Text To Speech is supported for the currently selected
+ // Voice Search language. If a Voice Search language has not been specified,
+ // returns whether Text To Speech is supported for the default Voice Search
+ // language.
+ virtual bool IsTextToSpeechSupported();
+
+ // Returns |true| if the voice search UI is visible.
+ virtual bool IsVisible();
+
+ // Returns |true| if text-to-speech audio is currently playing.
+ virtual bool IsPlayingAudio();
+
+ // Dismisses the mic permissions help UI, if shown.
+ virtual void DismissMicPermissionsHelp();
+
+ protected:
+ virtual ~VoiceSearchController();
+
+ private:
+ friend class base::RefCountedThreadSafe<VoiceSearchController>;
+
+ DISALLOW_COPY_AND_ASSIGN(VoiceSearchController);
+};
+
+#endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_VOICE_VOICE_SEARCH_CONTROLLER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698