| 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_accept_languages.h" | 5 #include "chrome/browser/translate/translate_accept_languages.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/prefs/pref_change_registrar.h" | 8 #include "base/prefs/pref_change_registrar.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/translate/translate_manager.h" | 15 #include "chrome/browser/translate/translate_manager.h" |
| 16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 #include "components/translate/common/translate_util.h" | 17 #include "components/translate/core/common/translate_util.h" |
| 18 #include "content/public/browser/notification_source.h" | 18 #include "content/public/browser/notification_source.h" |
| 19 #include "net/url_request/url_fetcher.h" | 19 #include "net/url_request/url_fetcher.h" |
| 20 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 21 | 21 |
| 22 TranslateAcceptLanguages::TranslateAcceptLanguages() { | 22 TranslateAcceptLanguages::TranslateAcceptLanguages() { |
| 23 } | 23 } |
| 24 | 24 |
| 25 TranslateAcceptLanguages::~TranslateAcceptLanguages() { | 25 TranslateAcceptLanguages::~TranslateAcceptLanguages() { |
| 26 } | 26 } |
| 27 | 27 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 size_t count = accept_languages_.erase(pref_service); | 114 size_t count = accept_languages_.erase(pref_service); |
| 115 // We should know about this profile since we are listening for | 115 // We should know about this profile since we are listening for |
| 116 // notifications on it. | 116 // notifications on it. |
| 117 DCHECK_EQ(1u, count); | 117 DCHECK_EQ(1u, count); |
| 118 PrefChangeRegistrar* pref_change_registrar = | 118 PrefChangeRegistrar* pref_change_registrar = |
| 119 pref_change_registrars_[pref_service]; | 119 pref_change_registrars_[pref_service]; |
| 120 count = pref_change_registrars_.erase(pref_service); | 120 count = pref_change_registrars_.erase(pref_service); |
| 121 DCHECK_EQ(1u, count); | 121 DCHECK_EQ(1u, count); |
| 122 delete pref_change_registrar; | 122 delete pref_change_registrar; |
| 123 } | 123 } |
| OLD | NEW |