| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_tts_api.h" | 5 #include "chrome/browser/speech/extension_api/tts_extension_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/extensions/extension_tts_api_constants.h" | |
| 11 #include "chrome/browser/extensions/extension_tts_api_controller.h" | |
| 12 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/speech/extension_api/tts_extension_api_constants.h" |
| 12 #include "chrome/browser/speech/extension_api/tts_extension_api_controller.h" |
| 13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
| 14 | 14 |
| 15 namespace constants = extension_tts_api_constants; | 15 namespace constants = tts_extension_api_constants; |
| 16 | 16 |
| 17 bool ExtensionTtsSpeakFunction::RunImpl() { | 17 bool ExtensionTtsSpeakFunction::RunImpl() { |
| 18 std::string text; | 18 std::string text; |
| 19 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &text)); | 19 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &text)); |
| 20 if (text.size() > 32768) { | 20 if (text.size() > 32768) { |
| 21 error_ = constants::kErrorUtteranceTooLong; | 21 error_ = constants::kErrorUtteranceTooLong; |
| 22 return false; | 22 return false; |
| 23 } | 23 } |
| 24 | 24 |
| 25 scoped_ptr<DictionaryValue> options(new DictionaryValue()); | 25 scoped_ptr<DictionaryValue> options(new DictionaryValue()); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 bool ExtensionTtsIsSpeakingFunction::RunImpl() { | 165 bool ExtensionTtsIsSpeakingFunction::RunImpl() { |
| 166 result_.reset(Value::CreateBooleanValue( | 166 result_.reset(Value::CreateBooleanValue( |
| 167 ExtensionTtsController::GetInstance()->IsSpeaking())); | 167 ExtensionTtsController::GetInstance()->IsSpeaking())); |
| 168 return true; | 168 return true; |
| 169 } | 169 } |
| 170 | 170 |
| 171 bool ExtensionTtsGetVoicesFunction::RunImpl() { | 171 bool ExtensionTtsGetVoicesFunction::RunImpl() { |
| 172 result_.reset(ExtensionTtsController::GetInstance()->GetVoices(profile())); | 172 result_.reset(ExtensionTtsController::GetInstance()->GetVoices(profile())); |
| 173 return true; | 173 return true; |
| 174 } | 174 } |
| OLD | NEW |