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

Side by Side Diff: components/translate/core/browser/translate_prefs.cc

Issue 2090283002: add experimental param to control the triggering threshold to default Always Translate checked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use auto Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/translate/core/browser/translate_prefs.h" 5 #include "components/translate/core/browser/translate_prefs.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 17 matching lines...) Expand all
28 const char TranslatePrefs::kPrefTranslateIgnoredCount[] = 28 const char TranslatePrefs::kPrefTranslateIgnoredCount[] =
29 "translate_ignored_count_for_language"; 29 "translate_ignored_count_for_language";
30 const char TranslatePrefs::kPrefTranslateAcceptedCount[] = 30 const char TranslatePrefs::kPrefTranslateAcceptedCount[] =
31 "translate_accepted_count"; 31 "translate_accepted_count";
32 const char TranslatePrefs::kPrefTranslateBlockedLanguages[] = 32 const char TranslatePrefs::kPrefTranslateBlockedLanguages[] =
33 "translate_blocked_languages"; 33 "translate_blocked_languages";
34 const char TranslatePrefs::kPrefTranslateLastDeniedTimeForLanguage[] = 34 const char TranslatePrefs::kPrefTranslateLastDeniedTimeForLanguage[] =
35 "translate_last_denied_time_for_language"; 35 "translate_last_denied_time_for_language";
36 const char TranslatePrefs::kPrefTranslateTooOftenDeniedForLanguage[] = 36 const char TranslatePrefs::kPrefTranslateTooOftenDeniedForLanguage[] =
37 "translate_too_often_denied_for_language"; 37 "translate_too_often_denied_for_language";
38 const char kTranslateUI2016Q2TrialName[] = "TranslateUI2016Q2";
39 const char kAlwaysTranslateOfferThreshold[] =
40 "always-translate-offer-threshold";
groby-ooo-7-16 2016/06/28 17:35:20 Our prefs usually use underscores instead of hyphe
ftang 2016/06/28 21:51:12 Done.
38 41
39 // The below properties used to be used but now are deprecated. Don't use them 42 // The below properties used to be used but now are deprecated. Don't use them
40 // since an old profile might have some values there. 43 // since an old profile might have some values there.
41 // 44 //
42 // * translate_last_denied_time 45 // * translate_last_denied_time
43 // * translate_too_often_denied 46 // * translate_too_often_denied
44 // * translate_language_blacklist 47 // * translate_language_blacklist
45 48
46 namespace { 49 namespace {
47 50
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 const base::ListValue* blacklist = prefs_->GetList(pref_id); 563 const base::ListValue* blacklist = prefs_->GetList(pref_id);
561 return (blacklist == NULL || blacklist->empty()); 564 return (blacklist == NULL || blacklist->empty());
562 } 565 }
563 566
564 bool TranslatePrefs::IsDictionaryEmpty(const char* pref_id) const { 567 bool TranslatePrefs::IsDictionaryEmpty(const char* pref_id) const {
565 const base::DictionaryValue* dict = prefs_->GetDictionary(pref_id); 568 const base::DictionaryValue* dict = prefs_->GetDictionary(pref_id);
566 return (dict == NULL || dict->empty()); 569 return (dict == NULL || dict->empty());
567 } 570 }
568 571
569 } // namespace translate 572 } // namespace translate
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698