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

Unified Diff: ios/chrome/browser/voice/text_to_speech_listener.h

Issue 2449593002: [ios] Adds support for parsing Text-to-Speech search results. (Closed)
Patch Set: Disabled 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
« no previous file with comments | « ios/chrome/browser/voice/BUILD.gn ('k') | ios/chrome/browser/voice/text_to_speech_listener.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/voice/text_to_speech_listener.h
diff --git a/ios/chrome/browser/voice/text_to_speech_listener.h b/ios/chrome/browser/voice/text_to_speech_listener.h
new file mode 100644
index 0000000000000000000000000000000000000000..8ad3595541f22f46cf92dce441b54ff81de13640
--- /dev/null
+++ b/ios/chrome/browser/voice/text_to_speech_listener.h
@@ -0,0 +1,50 @@
+// Copyright 2016 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_CHROME_BROWSER_VOICE_TEXT_TO_SPEECH_LISTENER_H_
+#define IOS_CHROME_BROWSER_VOICE_TEXT_TO_SPEECH_LISTENER_H_
+
+#import <Foundation/Foundation.h>
+
+class GURL;
+namespace web {
+class WebState;
+}
+
+@protocol TextToSpeechListenerDelegate;
+
+// Class that listens for page loads on a WebState and extracts TTS data.
+@interface TextToSpeechListener : NSObject
+
+// The WebState passed on initialization.
+@property(nonatomic, readonly) web::WebState* webState;
+
+// Designated initializer.
+- (instancetype)initWithWebState:(web::WebState*)webState
+ delegate:(id<TextToSpeechListenerDelegate>)delegate
+ NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
+
+@end
+
+@protocol TextToSpeechListenerDelegate<NSObject>
+
+// Called by |listener| when TTS audio data has been extracted from its
+// WebState. If a page load was encountered that was not a Voice Search SRP,
+// this function is called with a nil |result|.
+- (void)textToSpeechListener:(TextToSpeechListener*)listener
+ didReceiveResult:(NSData*)result;
+
+// Called by |listener| after its WebState is destroyed.
+- (void)textToSpeechListenerWebStateWasDestroyed:
+ (TextToSpeechListener*)listener;
+
+// Called by |listener| to determine whether |URL| is a Voice Search SRP with
+// Text-To-Speech data.
+- (BOOL)shouldTextToSpeechListener:(TextToSpeechListener*)listener
+ parseDataFromURL:(const GURL&)URL;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_VOICE_TEXT_TO_SPEECH_LISTENER_H_
« no previous file with comments | « ios/chrome/browser/voice/BUILD.gn ('k') | ios/chrome/browser/voice/text_to_speech_listener.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698