Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef IOS_CHROME_BROWSER_UI_VOICE_SPEECH_INPUT_LOCALE_CONFIG_H_ | |
| 6 #define IOS_CHROME_BROWSER_UI_VOICE_SPEECH_INPUT_LOCALE_CONFIG_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "ios/chrome/browser/ui/voice/speech_input_locale.h" | |
| 12 | |
| 13 namespace voice { | |
| 14 | |
| 15 class SpeechInputLocaleConfig; | |
| 16 | |
| 17 // Configuration object supplying information about valid locales for Voice | |
| 18 // Search. | |
| 19 class SpeechInputLocaleConfig { | |
| 20 public: | |
| 21 // Returns a pointer to the singleton object. | |
| 22 static SpeechInputLocaleConfig* GetInstance(); | |
| 23 | |
| 24 // Returns the default locale as determined by the system language. | |
| 25 virtual SpeechInputLocale GetDefaultLocale() = 0; | |
|
sdefresne
2016/10/17 16:12:39
Can this method be const?
virtual SpeechInputLoca
rohitrao (ping after 24h)
2016/10/17 17:42:27
Done.
| |
| 26 | |
| 27 // Returns a reference to a vector of SpeechInputLocales sorted alphabetically | |
| 28 // by their display names. | |
| 29 virtual const std::vector<SpeechInputLocale>& GetAvailableLocales() = 0; | |
|
sdefresne
2016/10/17 16:12:39
ditto, can this method be const?
rohitrao (ping after 24h)
2016/10/17 17:42:27
Done.
| |
| 30 | |
| 31 // Returns the SpeechInputLocale to use for |locale_code|. If |locale_code| is | |
| 32 // not contained in GetAvailableLocales()'s return value, then the | |
| 33 // SpeechInputLocaleConfig will attempt to match with an appropriate subsitute | |
| 34 // (e.g. "en-NZ" => "en-AU"). | |
| 35 virtual SpeechInputLocale GetLocaleForCode( | |
|
sdefresne
2016/10/17 16:12:39
ditto, can this method be const?
rohitrao (ping after 24h)
2016/10/17 17:42:27
Done.
| |
| 36 const std::string& locale_code) = 0; | |
| 37 | |
| 38 // Returns a reference to an alphabetically sorted vector containing language | |
| 39 // codes (e.g. "en", "fr") that can be used to trigger Text To Speech results. | |
| 40 virtual const std::vector<std::string>& GetTextToSpeechLanguages() = 0; | |
|
sdefresne
2016/10/17 16:12:39
ditto, can this method be const?
rohitrao (ping after 24h)
2016/10/17 17:42:26
Done.
| |
| 41 | |
| 42 // Returns whether the language portion of |locale_code| is an available | |
| 43 // TTS language. | |
| 44 virtual bool IsTextToSpeechEnabledForCode(const std::string& locale_code) = 0; | |
|
sdefresne
2016/10/17 16:12:39
ditto, can this method be const?
rohitrao (ping after 24h)
2016/10/17 17:42:27
Done.
| |
| 45 | |
| 46 protected: | |
| 47 SpeechInputLocaleConfig(); | |
|
sdefresne
2016/10/17 16:12:39
Can you use "= default" here and for the destructo
rohitrao (ping after 24h)
2016/10/17 17:42:26
Done.
| |
| 48 virtual ~SpeechInputLocaleConfig(); | |
| 49 }; | |
|
sdefresne
2016/10/17 16:12:39
DISALLOW_COPY_AND_ASSIGN?
rohitrao (ping after 24h)
2016/10/17 17:42:27
Done.
| |
| 50 | |
| 51 } // namespace voice | |
| 52 | |
| 53 #endif // IOS_CHROME_BROWSER_UI_VOICE_SPEECH_INPUT_LOCALE_CONFIG_H_ | |
| OLD | NEW |