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/ui/webui/translate_internals/translate_internals_handle
r.h" | 5 #include "chrome/browser/ui/webui/translate_internals/translate_internals_handle
r.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/translate/translate_error_details.h" | |
16 #include "chrome/browser/translate/translate_event_details.h" | |
17 #include "chrome/browser/translate/translate_prefs.h" | 15 #include "chrome/browser/translate/translate_prefs.h" |
18 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
19 #include "chrome/common/translate/language_detection_details.h" | 17 #include "components/translate/core/browser/translate_error_details.h" |
| 18 #include "components/translate/core/browser/translate_event_details.h" |
| 19 #include "components/translate/core/common/language_detection_details.h" |
20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
21 #include "content/public/browser/web_ui.h" | 21 #include "content/public/browser/web_ui.h" |
22 | 22 |
23 TranslateInternalsHandler::TranslateInternalsHandler() { | 23 TranslateInternalsHandler::TranslateInternalsHandler() { |
24 TranslateManager::GetInstance()->AddObserver(this); | 24 TranslateManager::GetInstance()->AddObserver(this); |
25 } | 25 } |
26 | 26 |
27 TranslateInternalsHandler::~TranslateInternalsHandler() { | 27 TranslateInternalsHandler::~TranslateInternalsHandler() { |
28 TranslateManager::GetInstance()->RemoveObserver(this); | 28 TranslateManager::GetInstance()->RemoveObserver(this); |
29 } | 29 } |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 if (TranslateManager::IsAlphaLanguage(lang)) | 179 if (TranslateManager::IsAlphaLanguage(lang)) |
180 alpha_languages_list->Append(new base::StringValue(lang)); | 180 alpha_languages_list->Append(new base::StringValue(lang)); |
181 } | 181 } |
182 | 182 |
183 dict.Set("languages", languages_list); | 183 dict.Set("languages", languages_list); |
184 dict.Set("alpha_languages", alpha_languages_list); | 184 dict.Set("alpha_languages", alpha_languages_list); |
185 dict.Set("last_updated", | 185 dict.Set("last_updated", |
186 new base::FundamentalValue(last_updated.ToJsTime())); | 186 new base::FundamentalValue(last_updated.ToJsTime())); |
187 SendMessageToJs("supportedLanguagesUpdated", dict); | 187 SendMessageToJs("supportedLanguagesUpdated", dict); |
188 } | 188 } |
OLD | NEW |