Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2634)

Unified Diff: chrome/browser/translate/translate_language_list.h

Issue 15470004: Translate: display alpha language name with (alpha) suffix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (rebase) Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/translate/translate_language_list.h
diff --git a/chrome/browser/translate/translate_language_list.h b/chrome/browser/translate/translate_language_list.h
index c9178648258474ebd62f0f51efbd3e46d38704b0..763fd79d276e119a84c703d3df4a70fccb3ef8f9 100644
--- a/chrome/browser/translate/translate_language_list.h
+++ b/chrome/browser/translate/translate_language_list.h
@@ -28,17 +28,23 @@ class TranslateLanguageList : public net::URLFetcherDelegate {
virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
// Fills |languages| with the list of languages that the translate server can
- // translate to and from.
+ // translate to and from. If alpha language support is enabled, it fills
+ // |languages| with the list of all supporting languages including alpha
+ // languages.
void GetSupportedLanguages(std::vector<std::string>* languages);
// Returns the language code that can be used with the Translate method for a
// specified |chrome_locale|.
std::string GetLanguageCode(const std::string& chrome_locale);
- // Returns true if |language| is supported by the translation server.
+ // Returns true if |language| is supported by the translation server. If alpha
+ // language support is enabled, returns true if |language| is in alpha
MAD 2013/05/31 15:14:52 This comment seems to say that when alpha is enabl
Takashi Toyoshima 2013/05/31 16:37:06 thanks!
+ // language list.
bool IsSupportedLanguage(const std::string& language);
- // TODO(toyoshim): Add IsSupportedAlphaLanguage() here.
+ // Returns true if |language| is supported by the translation server as a
+ // alpha language.
+ bool IsAlphaLanguage(const std::string& language);
// Fetches the language list from the translate server. It will not retry
// more than kMaxRetryLanguageListFetch times.
@@ -49,15 +55,29 @@ class TranslateLanguageList : public net::URLFetcherDelegate {
static const char kTargetLanguagesKey[];
private:
- // Parses |language_list| and fills |supported_languages_| with the list of
- // languages that the translate server can translate to and from.
- void SetSupportedLanguages(const std::string& language_list);
+ // Updates |supported_all_languages_| contains union of |supported_languages_|
MAD 2013/05/31 15:14:52 contains union -> to contain the union
Takashi Toyoshima 2013/05/31 16:37:06 Done.
+ // and |supported-alpha_languages_|.
MAD 2013/05/31 15:14:52 Nit: supported-alpha_languages_ -> supported_alpha
Takashi Toyoshima 2013/05/31 16:37:06 Done.
+ void UpdateSupportedLanguages();
// The languages supported by the translation server.
std::set<std::string> supported_languages_;
+ // The alpha languages supported by the translation server.
+ std::set<std::string> supported_alpha_languages_;
+
+ // The languages supported by the translation server. It contains union of
MAD 2013/05/31 15:14:52 I would say "All the languages supported..." and a
Takashi Toyoshima 2013/05/31 16:37:06 Done.
+ // |supported_languages_| and |supported_alpha_languages_|.
+ std::set<std::string> supported_all_languages_;
MAD 2013/05/31 15:14:52 I would rename it to all_supported_languages_.
Takashi Toyoshima 2013/05/31 16:37:06 Done.
+
// An URLFetcher instance to fetch a server providing supported language list.
- scoped_ptr<net::URLFetcher> url_fetcher_;
+ scoped_ptr<net::URLFetcher> language_list_fetcher_;
+
+ // An URLFetcher instance to fetch a server providing supported alpha language
+ // list.
+ scoped_ptr<net::URLFetcher> alpha_language_list_fetcher_;
+
+ // A flag to representing if alpha language support is enabled.
+ bool alpha_language_support_is_enabled_;
MAD 2013/05/31 15:14:52 You don't seem to be using that...
Takashi Toyoshima 2013/05/31 16:37:06 Thanks. I stop using it at the last clean up. Sorr
DISALLOW_COPY_AND_ASSIGN(TranslateLanguageList);
};
« no previous file with comments | « chrome/browser/translate/translate_infobar_delegate.cc ('k') | chrome/browser/translate/translate_language_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698