Commit 81250098 authored by Mohammad Refaat's avatar Mohammad Refaat Committed by Commit Bot

Add VoiceControlelr method that takes WebState instead of Tab.

This CL will be followed by another to BVC use the new method.

Bug: 982030
Change-Id: Icf5c11e060f9bfdaf9af15da3a44f6a04542c4c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1689923
Commit-Queue: Mohammad Refaat <mrefaat@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#675734}
parent fe38f471
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
@class Tab; @class Tab;
@class UIViewController; @class UIViewController;
namespace web {
class WebState;
}
// TODO(crbug.com/607204): Convert to Objective-C class. // TODO(crbug.com/607204): Convert to Objective-C class.
class VoiceSearchController class VoiceSearchController
: public base::RefCountedThreadSafe<VoiceSearchController> { : public base::RefCountedThreadSafe<VoiceSearchController> {
...@@ -23,12 +27,16 @@ class VoiceSearchController ...@@ -23,12 +27,16 @@ class VoiceSearchController
// Preloads views and view controllers needed for the voice search UI. // Preloads views and view controllers needed for the voice search UI.
virtual void PrepareToAppear(); virtual void PrepareToAppear();
// TODO(crbug.com/982030): Deprecated - This method will be removed after
// switching to use WebState instead of Tab.
virtual void StartRecognition(UIViewController* presenting_view_controller,
Tab* current_tab);
// Starts recognizing and recording process. Will call the delegate method // Starts recognizing and recording process. Will call the delegate method
// upon completion if the recognition succeeds. // upon completion if the recognition succeeds.
// |presenting_view_controller| is the UIViewController from which to present // |presenting_view_controller| is the UIViewController from which to present
// the Voice Search input UI. // the Voice Search input UI.
virtual void StartRecognition(UIViewController* presenting_view_controller, virtual void StartRecognition(UIViewController* presenting_view_controller,
Tab* current_tab); web::WebState* current_web_state);
// Whether or not the Text To Speech user preference is enabled. // Whether or not the Text To Speech user preference is enabled.
virtual bool IsTextToSpeechEnabled(); virtual bool IsTextToSpeechEnabled();
......
...@@ -22,6 +22,10 @@ void VoiceSearchController::StartRecognition( ...@@ -22,6 +22,10 @@ void VoiceSearchController::StartRecognition(
UIViewController* presenting_view_controller, UIViewController* presenting_view_controller,
Tab* current_tab) {} Tab* current_tab) {}
void VoiceSearchController::StartRecognition(
UIViewController* presenting_view_controller,
web::WebState* current_web_state) {}
bool VoiceSearchController::IsTextToSpeechEnabled() { bool VoiceSearchController::IsTextToSpeechEnabled() {
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment