| 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" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 std::string pref_name; | 139 std::string pref_name; |
| 140 if (!args->GetString(0, &pref_name)) | 140 if (!args->GetString(0, &pref_name)) |
| 141 return; | 141 return; |
| 142 | 142 |
| 143 if (pref_name == "blocked_languages") { | 143 if (pref_name == "blocked_languages") { |
| 144 std::string language; | 144 std::string language; |
| 145 if (!args->GetString(1, &language)) | 145 if (!args->GetString(1, &language)) |
| 146 return; | 146 return; |
| 147 translate_prefs->UnblockLanguage(language); | 147 translate_prefs->UnblockLanguage(language); |
| 148 } else if (pref_name == "language_blacklist") { | |
| 149 std::string language; | |
| 150 if (!args->GetString(1, &language)) | |
| 151 return; | |
| 152 translate_prefs->RemoveLanguageFromLegacyBlacklist(language); | |
| 153 } else if (pref_name == "site_blacklist") { | 148 } else if (pref_name == "site_blacklist") { |
| 154 std::string site; | 149 std::string site; |
| 155 if (!args->GetString(1, &site)) | 150 if (!args->GetString(1, &site)) |
| 156 return; | 151 return; |
| 157 translate_prefs->RemoveSiteFromBlacklist(site); | 152 translate_prefs->RemoveSiteFromBlacklist(site); |
| 158 } else if (pref_name == "whitelists") { | 153 } else if (pref_name == "whitelists") { |
| 159 std::string from, to; | 154 std::string from, to; |
| 160 if (!args->GetString(1, &from)) | 155 if (!args->GetString(1, &from)) |
| 161 return; | 156 return; |
| 162 if (!args->GetString(2, &to)) | 157 if (!args->GetString(2, &to)) |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 if (variations_service) | 250 if (variations_service) |
| 256 country = variations_service->GetStoredPermanentCountry(); | 251 country = variations_service->GetStoredPermanentCountry(); |
| 257 | 252 |
| 258 base::DictionaryValue dict; | 253 base::DictionaryValue dict; |
| 259 if (!country.empty()) { | 254 if (!country.empty()) { |
| 260 dict.Set("country", new base::StringValue(country)); | 255 dict.Set("country", new base::StringValue(country)); |
| 261 dict.Set("update", new base::FundamentalValue(was_updated)); | 256 dict.Set("update", new base::FundamentalValue(was_updated)); |
| 262 } | 257 } |
| 263 SendMessageToJs("countryUpdated", dict); | 258 SendMessageToJs("countryUpdated", dict); |
| 264 } | 259 } |
| OLD | NEW |