Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc

Issue 1978203002: Translate: Remove the legacy pref 'translate_language_blacklist' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/translate/core/browser/translate_prefs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | components/translate/core/browser/translate_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698