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

Side by Side Diff: chrome/browser/translate/translate_prefs.cc

Issue 7618021: base: Fix the TODO in ListValue::Remove(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/external_policy_extension_loader_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_prefs.h" 5 #include "chrome/browser/translate/translate_prefs.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "chrome/browser/prefs/pref_service.h" 8 #include "chrome/browser/prefs/pref_service.h"
9 #include "chrome/browser/prefs/scoped_user_pref_update.h" 9 #include "chrome/browser/prefs/scoped_user_pref_update.h"
10 10
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 const std::string& value) { 248 const std::string& value) {
249 bool schedule_save = false; 249 bool schedule_save = false;
250 { 250 {
251 ListPrefUpdate update(prefs_, pref_id); 251 ListPrefUpdate update(prefs_, pref_id);
252 ListValue* blacklist = update.Get(); 252 ListValue* blacklist = update.Get();
253 if (!blacklist) { 253 if (!blacklist) {
254 NOTREACHED() << "Unregistered translate blacklist pref"; 254 NOTREACHED() << "Unregistered translate blacklist pref";
255 return; 255 return;
256 } 256 }
257 StringValue string_value(value); 257 StringValue string_value(value);
258 schedule_save = blacklist->Remove(string_value) != -1; 258 schedule_save = blacklist->Remove(string_value, NULL);
259 } 259 }
260 if (schedule_save) 260 if (schedule_save)
261 prefs_->ScheduleSavePersistentPrefs(); 261 prefs_->ScheduleSavePersistentPrefs();
262 } 262 }
263 263
264 bool TranslatePrefs::IsLanguageWhitelisted( 264 bool TranslatePrefs::IsLanguageWhitelisted(
265 const std::string& original_language, std::string* target_language) { 265 const std::string& original_language, std::string* target_language) {
266 const DictionaryValue* dict = prefs_->GetDictionary(kPrefTranslateWhitelists); 266 const DictionaryValue* dict = prefs_->GetDictionary(kPrefTranslateWhitelists);
267 if (dict && dict->GetString(original_language, target_language)) { 267 if (dict && dict->GetString(original_language, target_language)) {
268 DCHECK(!target_language->empty()); 268 DCHECK(!target_language->empty());
269 return !target_language->empty(); 269 return !target_language->empty();
270 } 270 }
271 return false; 271 return false;
272 } 272 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/external_policy_extension_loader_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698