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

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

Issue 1923143003: Implement the 2016Q2 Translate UI designe spec out in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test breakage 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
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 PrefService* prefs = profile->GetOriginalProfile()->GetPrefs(); 207 PrefService* prefs = profile->GetOriginalProfile()->GetPrefs();
208 208
209 base::DictionaryValue dict; 209 base::DictionaryValue dict;
210 210
211 static const char* keys[] = { 211 static const char* keys[] = {
212 prefs::kEnableTranslate, 212 prefs::kEnableTranslate,
213 translate::TranslatePrefs::kPrefTranslateBlockedLanguages, 213 translate::TranslatePrefs::kPrefTranslateBlockedLanguages,
214 translate::TranslatePrefs::kPrefTranslateSiteBlacklist, 214 translate::TranslatePrefs::kPrefTranslateSiteBlacklist,
215 translate::TranslatePrefs::kPrefTranslateWhitelists, 215 translate::TranslatePrefs::kPrefTranslateWhitelists,
216 translate::TranslatePrefs::kPrefTranslateDeniedCount, 216 translate::TranslatePrefs::kPrefTranslateDeniedCount,
217 translate::TranslatePrefs::kPrefTranslateIgnoredCount,
217 translate::TranslatePrefs::kPrefTranslateAcceptedCount, 218 translate::TranslatePrefs::kPrefTranslateAcceptedCount,
218 translate::TranslatePrefs::kPrefTranslateLastDeniedTimeForLanguage, 219 translate::TranslatePrefs::kPrefTranslateLastDeniedTimeForLanguage,
219 translate::TranslatePrefs::kPrefTranslateTooOftenDeniedForLanguage, 220 translate::TranslatePrefs::kPrefTranslateTooOftenDeniedForLanguage,
220 }; 221 };
221 for (const char* key : keys) { 222 for (const char* key : keys) {
222 const PrefService::Preference* pref = prefs->FindPreference(key); 223 const PrefService::Preference* pref = prefs->FindPreference(key);
223 if (pref) 224 if (pref)
224 dict.Set(key, pref->GetValue()->DeepCopy()); 225 dict.Set(key, pref->GetValue()->DeepCopy());
225 } 226 }
226 227
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 if (variations_service) 260 if (variations_service)
260 country = variations_service->GetStoredPermanentCountry(); 261 country = variations_service->GetStoredPermanentCountry();
261 262
262 base::DictionaryValue dict; 263 base::DictionaryValue dict;
263 if (!country.empty()) { 264 if (!country.empty()) {
264 dict.Set("country", new base::StringValue(country)); 265 dict.Set("country", new base::StringValue(country));
265 dict.Set("update", new base::FundamentalValue(was_updated)); 266 dict.Set("update", new base::FundamentalValue(was_updated));
266 } 267 }
267 SendMessageToJs("countryUpdated", dict); 268 SendMessageToJs("countryUpdated", dict);
268 } 269 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698