| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/ui/search/search.h" | 5 #include "chrome/browser/ui/search/search.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 311 } |
| 312 | 312 |
| 313 void RegisterUserPrefs(PrefRegistrySyncable* registry) { | 313 void RegisterUserPrefs(PrefRegistrySyncable* registry) { |
| 314 registry->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, false, | 314 registry->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, false, |
| 315 PrefRegistrySyncable::SYNCABLE_PREF); | 315 PrefRegistrySyncable::SYNCABLE_PREF); |
| 316 registry->RegisterBooleanPref(prefs::kInstantEnabled, false, | 316 registry->RegisterBooleanPref(prefs::kInstantEnabled, false, |
| 317 PrefRegistrySyncable::SYNCABLE_PREF); | 317 PrefRegistrySyncable::SYNCABLE_PREF); |
| 318 // This default is overridden by SetInstantExtendedPrefDefault(). | 318 // This default is overridden by SetInstantExtendedPrefDefault(). |
| 319 registry->RegisterBooleanPref(prefs::kInstantExtendedEnabled, false, | 319 registry->RegisterBooleanPref(prefs::kInstantExtendedEnabled, false, |
| 320 PrefRegistrySyncable::SYNCABLE_PREF); | 320 PrefRegistrySyncable::SYNCABLE_PREF); |
| 321 |
| 322 // TODO(jered): Remove this. |
| 323 registry->RegisterStringPref(prefs::kInstantUIZeroSuggestUrlPrefix, "", |
| 324 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 321 } | 325 } |
| 322 | 326 |
| 323 const char* GetInstantPrefName() { | 327 const char* GetInstantPrefName() { |
| 324 return IsInstantExtendedAPIEnabled() ? prefs::kInstantExtendedEnabled : | 328 return IsInstantExtendedAPIEnabled() ? prefs::kInstantExtendedEnabled : |
| 325 prefs::kInstantEnabled; | 329 prefs::kInstantEnabled; |
| 326 } | 330 } |
| 327 | 331 |
| 328 bool IsInstantPrefEnabled(Profile* profile) { | 332 bool IsInstantPrefEnabled(Profile* profile) { |
| 329 if (!profile || profile->IsOffTheRecord()) | 333 if (!profile || profile->IsOffTheRecord()) |
| 330 return false; | 334 return false; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 GURL::Replacements replacements; | 525 GURL::Replacements replacements; |
| 522 replacements.SetSchemeStr(search_scheme); | 526 replacements.SetSchemeStr(search_scheme); |
| 523 replacements.SetHostStr(search_host); | 527 replacements.SetHostStr(search_host); |
| 524 replacements.SetPortStr(search_port); | 528 replacements.SetPortStr(search_port); |
| 525 replacements.SetPathStr(search_path); | 529 replacements.SetPathStr(search_path); |
| 526 return instant_url.ReplaceComponents(replacements); | 530 return instant_url.ReplaceComponents(replacements); |
| 527 } | 531 } |
| 528 | 532 |
| 529 } // namespace search | 533 } // namespace search |
| 530 } // namespace chrome | 534 } // namespace chrome |
| OLD | NEW |