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 "chrome/browser/translate/translate_language_list.h" | 5 #include "chrome/browser/translate/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 "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/translate/translate_browser_metrics.h" | |
18 #include "chrome/browser/translate/translate_manager.h" | 17 #include "chrome/browser/translate/translate_manager.h" |
19 #include "chrome/browser/translate/translate_url_fetcher.h" | 18 #include "chrome/browser/translate/translate_url_fetcher.h" |
20 #include "chrome/browser/translate/translate_url_util.h" | 19 #include "chrome/browser/translate/translate_url_util.h" |
| 20 #include "components/translate/core/browser/translate_browser_metrics.h" |
21 #include "components/translate/core/browser/translate_event_details.h" | 21 #include "components/translate/core/browser/translate_event_details.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 { | 26 namespace { |
27 | 27 |
28 // The default list of languages the Google translation server supports. | 28 // The default list of languages the Google translation server supports. |
29 // We use this list until we receive the list that the server exposes. | 29 // 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 | 30 // For information, here is the list of languages that Chrome can be run in |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 320 |
321 NotifyEvent(__LINE__, "Language list is updated"); | 321 NotifyEvent(__LINE__, "Language list is updated"); |
322 | 322 |
323 DCHECK_EQ(kFetcherId, id); | 323 DCHECK_EQ(kFetcherId, id); |
324 | 324 |
325 SetSupportedLanguages(data, &all_supported_languages_, &alpha_languages_); | 325 SetSupportedLanguages(data, &all_supported_languages_, &alpha_languages_); |
326 language_list_fetcher_.reset(); | 326 language_list_fetcher_.reset(); |
327 | 327 |
328 last_updated_ = base::Time::Now(); | 328 last_updated_ = base::Time::Now(); |
329 } | 329 } |
OLD | NEW |