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

Side by Side Diff: chrome/browser/autocomplete/zero_suggest_provider.cc

Issue 1102733002: Remove most occurences of PrefRegistrySyncable::UNSYNCABLE_PREF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs-add-reg-funcs
Patch Set: Created 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/autocomplete/zero_suggest_provider.h" 5 #include "chrome/browser/autocomplete/zero_suggest_provider.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/i18n/case_conversion.h" 8 #include "base/i18n/case_conversion.h"
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 ZeroSuggestProvider* ZeroSuggestProvider::Create( 78 ZeroSuggestProvider* ZeroSuggestProvider::Create(
79 AutocompleteProviderListener* listener, 79 AutocompleteProviderListener* listener,
80 TemplateURLService* template_url_service, 80 TemplateURLService* template_url_service,
81 Profile* profile) { 81 Profile* profile) {
82 return new ZeroSuggestProvider(listener, template_url_service, profile); 82 return new ZeroSuggestProvider(listener, template_url_service, profile);
83 } 83 }
84 84
85 // static 85 // static
86 void ZeroSuggestProvider::RegisterProfilePrefs( 86 void ZeroSuggestProvider::RegisterProfilePrefs(
87 user_prefs::PrefRegistrySyncable* registry) { 87 user_prefs::PrefRegistrySyncable* registry) {
88 registry->RegisterStringPref( 88 registry->RegisterStringPref(prefs::kZeroSuggestCachedResults, std::string());
89 prefs::kZeroSuggestCachedResults,
90 std::string(),
91 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
92 } 89 }
93 90
94 void ZeroSuggestProvider::Start(const AutocompleteInput& input, 91 void ZeroSuggestProvider::Start(const AutocompleteInput& input,
95 bool minimal_changes, 92 bool minimal_changes,
96 bool called_due_to_focus) { 93 bool called_due_to_focus) {
97 matches_.clear(); 94 matches_.clear();
98 if (!called_due_to_focus || 95 if (!called_due_to_focus ||
99 input.type() == metrics::OmniboxInputType::INVALID) 96 input.type() == metrics::OmniboxInputType::INVALID)
100 return; 97 return;
101 98
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 if (!json_data.empty()) { 483 if (!json_data.empty()) {
487 scoped_ptr<base::Value> data( 484 scoped_ptr<base::Value> data(
488 SearchSuggestionParser::DeserializeJsonData(json_data)); 485 SearchSuggestionParser::DeserializeJsonData(json_data));
489 if (data && ParseSuggestResults( 486 if (data && ParseSuggestResults(
490 *data, kDefaultZeroSuggestRelevance, false, &results_)) { 487 *data, kDefaultZeroSuggestRelevance, false, &results_)) {
491 ConvertResultsToAutocompleteMatches(); 488 ConvertResultsToAutocompleteMatches();
492 results_from_cache_ = !matches_.empty(); 489 results_from_cache_ = !matches_.empty();
493 } 490 }
494 } 491 }
495 } 492 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/shortcut_manager.cc ('k') | chrome/browser/background/background_contents_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698