summaryrefslogtreecommitdiffstats
path: root/chrome/browser/speech
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/speech')
-rw-r--r--chrome/browser/speech/speech_input_bubble_controller.cc26
-rw-r--r--chrome/browser/speech/speech_input_bubble_controller_unittest.cc14
-rw-r--r--chrome/browser/speech/speech_input_dispatcher_host.cc8
-rw-r--r--chrome/browser/speech/speech_input_manager.cc4
-rw-r--r--chrome/browser/speech/speech_recognizer.cc10
-rw-r--r--chrome/browser/speech/speech_recognizer_unittest.cc4
6 files changed, 33 insertions, 33 deletions
diff --git a/chrome/browser/speech/speech_input_bubble_controller.cc b/chrome/browser/speech/speech_input_bubble_controller.cc
index bf1f923..4cde92e 100644
--- a/chrome/browser/speech/speech_input_bubble_controller.cc
+++ b/chrome/browser/speech/speech_input_bubble_controller.cc
@@ -24,15 +24,15 @@ void SpeechInputBubbleController::CreateBubble(int caller_id,
int render_process_id,
int render_view_id,
const gfx::Rect& element_rect) {
- if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &SpeechInputBubbleController::CreateBubble,
caller_id, render_process_id, render_view_id,
element_rect));
return;
}
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
TabContents* tab_contents = tab_util::GetTabContentsByID(render_process_id,
render_view_id);
@@ -72,13 +72,13 @@ void SpeechInputBubbleController::SetBubbleMessage(int caller_id,
void SpeechInputBubbleController::ProcessRequestInUiThread(
int caller_id, RequestType type, const string16& text, float volume) {
- if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) {
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, NewRunnableMethod(
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(
this, &SpeechInputBubbleController::ProcessRequestInUiThread,
caller_id, type, text, volume));
return;
}
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// The bubble may have been closed before we got a chance to process this
// request. So check before proceeding.
if (!bubbles_.count(caller_id))
@@ -123,11 +123,11 @@ void SpeechInputBubbleController::ProcessRequestInUiThread(
void SpeechInputBubbleController::InfoBubbleButtonClicked(
SpeechInputBubble::Button button) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(current_bubble_caller_id_);
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this,
&SpeechInputBubbleController::InvokeDelegateButtonClicked,
@@ -135,15 +135,15 @@ void SpeechInputBubbleController::InfoBubbleButtonClicked(
}
void SpeechInputBubbleController::InfoBubbleFocusChanged() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(current_bubble_caller_id_);
int old_bubble_caller_id = current_bubble_caller_id_;
current_bubble_caller_id_ = 0;
bubbles_[old_bubble_caller_id]->Hide();
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
NewRunnableMethod(
this,
&SpeechInputBubbleController::InvokeDelegateFocusChanged,
diff --git a/chrome/browser/speech/speech_input_bubble_controller_unittest.cc b/chrome/browser/speech/speech_input_bubble_controller_unittest.cc
index f837130..55d7cc0 100644
--- a/chrome/browser/speech/speech_input_bubble_controller_unittest.cc
+++ b/chrome/browser/speech/speech_input_bubble_controller_unittest.cc
@@ -66,8 +66,8 @@ class SpeechInputBubbleControllerTest
public:
SpeechInputBubbleControllerTest()
: io_loop_(MessageLoop::TYPE_IO),
- ui_thread_(ChromeThread::UI), // constructs a new thread and loop
- io_thread_(ChromeThread::IO, &io_loop_), // resuses main thread loop
+ ui_thread_(BrowserThread::UI), // constructs a new thread and loop
+ io_thread_(BrowserThread::IO, &io_loop_), // resuses main thread loop
cancel_clicked_(false),
try_again_clicked_(false),
focus_changed_(false),
@@ -85,7 +85,7 @@ class SpeechInputBubbleControllerTest
virtual void InfoBubbleButtonClicked(int caller_id,
SpeechInputBubble::Button button) {
LOG(INFO) << "Received InfoBubbleButtonClicked for button " << button;
- EXPECT_TRUE(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (button == SpeechInputBubble::BUTTON_CANCEL) {
cancel_clicked_ = true;
} else if (button == SpeechInputBubble::BUTTON_TRY_AGAIN) {
@@ -96,7 +96,7 @@ class SpeechInputBubbleControllerTest
virtual void InfoBubbleFocusChanged(int caller_id) {
LOG(INFO) << "Received InfoBubbleFocusChanged";
- EXPECT_TRUE(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
focus_changed_ = true;
MessageLoop::current()->Quit();
}
@@ -126,7 +126,7 @@ class SpeechInputBubbleControllerTest
static SpeechInputBubble* CreateBubble(TabContents* tab_contents,
SpeechInputBubble::Delegate* delegate,
const gfx::Rect& element_rect) {
- EXPECT_TRUE(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Set up to activate the bubble soon after it gets created, since we test
// events sent by the bubble and those are handled only when the bubble is
// active.
@@ -139,8 +139,8 @@ class SpeechInputBubbleControllerTest
// The main thread of the test is marked as the IO thread and we create a new
// one for the UI thread.
MessageLoop io_loop_;
- ChromeThread ui_thread_;
- ChromeThread io_thread_;
+ BrowserThread ui_thread_;
+ BrowserThread io_thread_;
bool cancel_clicked_;
bool try_again_clicked_;
bool focus_changed_;
diff --git a/chrome/browser/speech/speech_input_dispatcher_host.cc b/chrome/browser/speech/speech_input_dispatcher_host.cc
index 7532e09..5c13e5c 100644
--- a/chrome/browser/speech/speech_input_dispatcher_host.cc
+++ b/chrome/browser/speech/speech_input_dispatcher_host.cc
@@ -119,7 +119,7 @@ SpeechInputManager* SpeechInputDispatcherHost::manager() {
bool SpeechInputDispatcherHost::OnMessageReceived(
const IPC::Message& msg, bool* msg_was_ok) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
bool handled = true;
IPC_BEGIN_MESSAGE_MAP_EX(SpeechInputDispatcherHost, msg, *msg_was_ok)
IPC_MESSAGE_HANDLER(ViewHostMsg_SpeechInput_StartRecognition,
@@ -169,7 +169,7 @@ void SpeechInputDispatcherHost::SendMessageToRenderView(IPC::Message* message,
void SpeechInputDispatcherHost::SetRecognitionResult(int caller_id,
const string16& result) {
LOG(INFO) << "SpeechInputDispatcherHost::SetRecognitionResult enter";
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
int caller_render_view_id = callers_->render_view_id(caller_id);
int caller_request_id = callers_->request_id(caller_id);
SendMessageToRenderView(
@@ -182,7 +182,7 @@ void SpeechInputDispatcherHost::SetRecognitionResult(int caller_id,
void SpeechInputDispatcherHost::DidCompleteRecording(int caller_id) {
LOG(INFO) << "SpeechInputDispatcherHost::DidCompleteRecording enter";
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
int caller_render_view_id = callers_->render_view_id(caller_id);
int caller_request_id = callers_->request_id(caller_id);
SendMessageToRenderView(
@@ -194,7 +194,7 @@ void SpeechInputDispatcherHost::DidCompleteRecording(int caller_id) {
void SpeechInputDispatcherHost::DidCompleteRecognition(int caller_id) {
LOG(INFO) << "SpeechInputDispatcherHost::DidCompleteRecognition enter";
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
int caller_render_view_id = callers_->render_view_id(caller_id);
int caller_request_id = callers_->request_id(caller_id);
SendMessageToRenderView(
diff --git a/chrome/browser/speech/speech_input_manager.cc b/chrome/browser/speech/speech_input_manager.cc
index a029bb4..dc96730f 100644
--- a/chrome/browser/speech/speech_input_manager.cc
+++ b/chrome/browser/speech/speech_input_manager.cc
@@ -222,7 +222,7 @@ void SpeechInputManagerImpl::CancelRecognitionAndInformDelegate(int caller_id) {
void SpeechInputManagerImpl::InfoBubbleButtonClicked(
int caller_id, SpeechInputBubble::Button button) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Ignore if the caller id was not in our active recognizers list because the
// user might have clicked more than once, or recognition could have been
// cancelled due to other reasons before the user click was processed.
@@ -237,7 +237,7 @@ void SpeechInputManagerImpl::InfoBubbleButtonClicked(
}
void SpeechInputManagerImpl::InfoBubbleFocusChanged(int caller_id) {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Ignore if the caller id was not in our active recognizers list because the
// user might have clicked more than once, or recognition could have been
// ended due to other reasons before the user click was processed.
diff --git a/chrome/browser/speech/speech_recognizer.cc b/chrome/browser/speech/speech_recognizer.cc
index a9f92e0..b4f75c7 100644
--- a/chrome/browser/speech/speech_recognizer.cc
+++ b/chrome/browser/speech/speech_recognizer.cc
@@ -131,7 +131,7 @@ SpeechRecognizer::~SpeechRecognizer() {
}
bool SpeechRecognizer::StartRecording() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(!audio_controller_.get());
DCHECK(!request_.get() || !request_->HasPendingRequest());
@@ -155,7 +155,7 @@ bool SpeechRecognizer::StartRecording() {
}
void SpeechRecognizer::CancelRecognition() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(audio_controller_.get() || request_.get());
// Stop recording if required.
@@ -171,7 +171,7 @@ void SpeechRecognizer::CancelRecognition() {
}
void SpeechRecognizer::StopRecording() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// If audio recording has already stopped and we are in recognition phase,
// silently ignore any more calls to stop recording.
@@ -225,7 +225,7 @@ void SpeechRecognizer::ReleaseAudioBuffers() {
// Invoked in the audio thread.
void SpeechRecognizer::OnError(AudioInputController* controller,
int error_code) {
- ChromeThread::PostTask(ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this,
&SpeechRecognizer::HandleOnError,
error_code));
@@ -249,7 +249,7 @@ void SpeechRecognizer::OnData(AudioInputController* controller,
return;
string* str_data = new string(reinterpret_cast<const char*>(data), size);
- ChromeThread::PostTask(ChromeThread::IO, FROM_HERE,
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this,
&SpeechRecognizer::HandleOnData,
str_data));
diff --git a/chrome/browser/speech/speech_recognizer_unittest.cc b/chrome/browser/speech/speech_recognizer_unittest.cc
index e049558..be9fa79 100644
--- a/chrome/browser/speech/speech_recognizer_unittest.cc
+++ b/chrome/browser/speech/speech_recognizer_unittest.cc
@@ -21,7 +21,7 @@ class SpeechRecognizerTest : public SpeechRecognizerDelegate,
public testing::Test {
public:
SpeechRecognizerTest()
- : io_thread_(ChromeThread::IO, &message_loop_),
+ : io_thread_(BrowserThread::IO, &message_loop_),
ALLOW_THIS_IN_INITIALIZER_LIST(
recognizer_(new SpeechRecognizer(this, 1))),
recording_complete_(false),
@@ -87,7 +87,7 @@ class SpeechRecognizerTest : public SpeechRecognizerDelegate,
protected:
MessageLoopForIO message_loop_;
- ChromeThread io_thread_;
+ BrowserThread io_thread_;
scoped_refptr<SpeechRecognizer> recognizer_;
bool recording_complete_;
bool recognition_complete_;