OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/translate/core/browser/translate_language_list.h" | 5 #include "components/translate/core/browser/translate_language_list.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "components/translate/core/browser/translate_browser_metrics.h" | 16 #include "components/translate/core/browser/translate_browser_metrics.h" |
17 #include "components/translate/core/browser/translate_download_manager.h" | 17 #include "components/translate/core/browser/translate_download_manager.h" |
18 #include "components/translate/core/browser/translate_event_details.h" | 18 #include "components/translate/core/browser/translate_event_details.h" |
19 #include "components/translate/core/browser/translate_url_fetcher.h" | 19 #include "components/translate/core/browser/translate_url_fetcher.h" |
20 #include "components/translate/core/browser/translate_url_util.h" | 20 #include "components/translate/core/browser/translate_url_util.h" |
21 #include "components/translate/core/common/translate_util.h" | 21 #include "components/translate/core/common/translate_util.h" |
22 #include "net/base/url_util.h" | 22 #include "net/base/url_util.h" |
23 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
25 | 25 |
| 26 namespace translate { |
| 27 |
26 namespace { | 28 namespace { |
27 | 29 |
28 // The default list of languages the Google translation server supports. | 30 // The default list of languages the Google translation server supports. |
29 // We use this list until we receive the list that the server exposes. | 31 // We use this list until we receive the list that the server exposes. |
30 // For information, here is the list of languages that Chrome can be run in | 32 // For information, here is the list of languages that Chrome can be run in |
31 // but that the translation server does not support: | 33 // but that the translation server does not support: |
32 // am Amharic | 34 // am Amharic |
33 // bn Bengali | 35 // bn Bengali |
34 // gu Gujarati | 36 // gu Gujarati |
35 // kn Kannada | 37 // kn Kannada |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 // languages, and don't use UMA or NotifyEvent. | 332 // languages, and don't use UMA or NotifyEvent. |
331 alpha_languages_.clear(); | 333 alpha_languages_.clear(); |
332 for (base::DictionaryValue::Iterator iter(*alpha_languages); | 334 for (base::DictionaryValue::Iterator iter(*alpha_languages); |
333 !iter.IsAtEnd(); iter.Advance()) { | 335 !iter.IsAtEnd(); iter.Advance()) { |
334 const std::string& lang = iter.key(); | 336 const std::string& lang = iter.key(); |
335 if (!l10n_util::IsLocaleNameTranslated(lang.c_str(), locale)) | 337 if (!l10n_util::IsLocaleNameTranslated(lang.c_str(), locale)) |
336 continue; | 338 continue; |
337 alpha_languages_.insert(lang); | 339 alpha_languages_.insert(lang); |
338 } | 340 } |
339 } | 341 } |
| 342 |
| 343 } // namespace translate |
OLD | NEW |