| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/speech/tts_message_filter.h" | 5 #include "chrome/browser/speech/tts_message_filter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/speech/tts_controller.h" | 10 #include "chrome/browser/speech/tts_controller.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 case TtsHostMsg_InitializeVoiceList::ID: | 28 case TtsHostMsg_InitializeVoiceList::ID: |
| 29 case TtsHostMsg_Speak::ID: | 29 case TtsHostMsg_Speak::ID: |
| 30 case TtsHostMsg_Pause::ID: | 30 case TtsHostMsg_Pause::ID: |
| 31 case TtsHostMsg_Resume::ID: | 31 case TtsHostMsg_Resume::ID: |
| 32 case TtsHostMsg_Cancel::ID: | 32 case TtsHostMsg_Cancel::ID: |
| 33 *thread = BrowserThread::UI; | 33 *thread = BrowserThread::UI; |
| 34 break; | 34 break; |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 | 37 |
| 38 bool TtsMessageFilter::OnMessageReceived(const IPC::Message& message, | 38 bool TtsMessageFilter::OnMessageReceived(const IPC::Message& message) { |
| 39 bool* message_was_ok) { | |
| 40 bool handled = true; | 39 bool handled = true; |
| 41 IPC_BEGIN_MESSAGE_MAP_EX(TtsMessageFilter, message, *message_was_ok) | 40 IPC_BEGIN_MESSAGE_MAP(TtsMessageFilter, message) |
| 42 IPC_MESSAGE_HANDLER(TtsHostMsg_InitializeVoiceList, OnInitializeVoiceList) | 41 IPC_MESSAGE_HANDLER(TtsHostMsg_InitializeVoiceList, OnInitializeVoiceList) |
| 43 IPC_MESSAGE_HANDLER(TtsHostMsg_Speak, OnSpeak) | 42 IPC_MESSAGE_HANDLER(TtsHostMsg_Speak, OnSpeak) |
| 44 IPC_MESSAGE_HANDLER(TtsHostMsg_Pause, OnPause) | 43 IPC_MESSAGE_HANDLER(TtsHostMsg_Pause, OnPause) |
| 45 IPC_MESSAGE_HANDLER(TtsHostMsg_Resume, OnResume) | 44 IPC_MESSAGE_HANDLER(TtsHostMsg_Resume, OnResume) |
| 46 IPC_MESSAGE_HANDLER(TtsHostMsg_Cancel, OnCancel) | 45 IPC_MESSAGE_HANDLER(TtsHostMsg_Cancel, OnCancel) |
| 47 IPC_MESSAGE_UNHANDLED(handled = false) | 46 IPC_MESSAGE_UNHANDLED(handled = false) |
| 48 IPC_END_MESSAGE_MAP() | 47 IPC_END_MESSAGE_MAP() |
| 49 return handled; | 48 return handled; |
| 50 } | 49 } |
| 51 | 50 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 OnInitializeVoiceList(); | 153 OnInitializeVoiceList(); |
| 155 } | 154 } |
| 156 | 155 |
| 157 void TtsMessageFilter::OnChannelClosingInUIThread() { | 156 void TtsMessageFilter::OnChannelClosingInUIThread() { |
| 158 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 157 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 159 TtsController::GetInstance()->RemoveVoicesChangedDelegate(this); | 158 TtsController::GetInstance()->RemoveVoicesChangedDelegate(this); |
| 160 } | 159 } |
| 161 | 160 |
| 162 TtsMessageFilter::~TtsMessageFilter() { | 161 TtsMessageFilter::~TtsMessageFilter() { |
| 163 } | 162 } |
| OLD | NEW |