| 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 <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/chrome_notification_types.h" | 16 #include "chrome/browser/chrome_notification_types.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/translate/chrome_translate_client.h" | 18 #include "chrome/browser/translate/chrome_translate_client.h" |
| 19 #include "chrome/browser/translate/translate_service.h" | 19 #include "chrome/browser/translate/translate_service.h" |
| 20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
| 21 #include "components/prefs/pref_service.h" | 21 #include "components/prefs/pref_service.h" |
| 22 #include "components/translate/core/browser/translate_download_manager.h" | 22 #include "components/translate/core/browser/translate_download_manager.h" |
| 23 #include "components/translate/core/browser/translate_error_details.h" | 23 #include "components/translate/core/browser/translate_error_details.h" |
| 24 #include "components/translate/core/browser/translate_event_details.h" | 24 #include "components/translate/core/browser/translate_event_details.h" |
| 25 #include "components/translate/core/browser/translate_pref_names.h" |
| 25 #include "components/translate/core/browser/translate_prefs.h" | 26 #include "components/translate/core/browser/translate_prefs.h" |
| 26 #include "components/translate/core/common/language_detection_details.h" | 27 #include "components/translate/core/common/language_detection_details.h" |
| 27 #include "components/translate/core/common/translate_pref_names.h" | |
| 28 #include "components/variations/service/variations_service.h" | 28 #include "components/variations/service/variations_service.h" |
| 29 #include "content/public/browser/notification_details.h" | 29 #include "content/public/browser/notification_details.h" |
| 30 #include "content/public/browser/notification_service.h" | 30 #include "content/public/browser/notification_service.h" |
| 31 #include "content/public/browser/notification_source.h" | 31 #include "content/public/browser/notification_source.h" |
| 32 #include "content/public/browser/notification_types.h" | 32 #include "content/public/browser/notification_types.h" |
| 33 #include "content/public/browser/web_contents.h" | 33 #include "content/public/browser/web_contents.h" |
| 34 #include "content/public/browser/web_ui.h" | 34 #include "content/public/browser/web_ui.h" |
| 35 | 35 |
| 36 TranslateInternalsHandler::TranslateInternalsHandler() { | 36 TranslateInternalsHandler::TranslateInternalsHandler() { |
| 37 notification_registrar_.Add(this, | 37 notification_registrar_.Add(this, |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 if (variations_service) | 247 if (variations_service) |
| 248 country = variations_service->GetStoredPermanentCountry(); | 248 country = variations_service->GetStoredPermanentCountry(); |
| 249 | 249 |
| 250 base::DictionaryValue dict; | 250 base::DictionaryValue dict; |
| 251 if (!country.empty()) { | 251 if (!country.empty()) { |
| 252 dict.SetString("country", country); | 252 dict.SetString("country", country); |
| 253 dict.SetBoolean("update", was_updated); | 253 dict.SetBoolean("update", was_updated); |
| 254 } | 254 } |
| 255 SendMessageToJs("countryUpdated", dict); | 255 SendMessageToJs("countryUpdated", dict); |
| 256 } | 256 } |
| OLD | NEW |