| 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/search/search.h" | 5 #include "chrome/browser/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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 } | 340 } |
| 341 | 341 |
| 342 bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile) { | 342 bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile) { |
| 343 return url.is_valid() && | 343 return url.is_valid() && |
| 344 profile && | 344 profile && |
| 345 (url.SchemeIs(chrome::kChromeSearchScheme) || | 345 (url.SchemeIs(chrome::kChromeSearchScheme) || |
| 346 IsInstantURL(url, profile)); | 346 IsInstantURL(url, profile)); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void RegisterInstantUserPrefs(PrefRegistrySyncable* registry) { | 349 void RegisterInstantUserPrefs(PrefRegistrySyncable* registry) { |
| 350 registry->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, false, | |
| 351 PrefRegistrySyncable::SYNCABLE_PREF); | |
| 352 registry->RegisterBooleanPref(prefs::kInstantEnabled, false, | 350 registry->RegisterBooleanPref(prefs::kInstantEnabled, false, |
| 353 PrefRegistrySyncable::SYNCABLE_PREF); | 351 PrefRegistrySyncable::SYNCABLE_PREF); |
| 354 // This default is overridden by SetInstantExtendedPrefDefault(). | 352 // This default is overridden by SetInstantExtendedPrefDefault(). |
| 355 registry->RegisterBooleanPref(prefs::kInstantExtendedEnabled, false, | 353 registry->RegisterBooleanPref(prefs::kInstantExtendedEnabled, false, |
| 356 PrefRegistrySyncable::SYNCABLE_PREF); | 354 PrefRegistrySyncable::SYNCABLE_PREF); |
| 357 } | 355 } |
| 358 | 356 |
| 359 const char* GetInstantPrefName() { | 357 const char* GetInstantPrefName() { |
| 360 return IsInstantExtendedAPIEnabled() ? prefs::kInstantExtendedEnabled : | 358 return IsInstantExtendedAPIEnabled() ? prefs::kInstantExtendedEnabled : |
| 361 prefs::kInstantEnabled; | 359 prefs::kInstantEnabled; |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 replacements.SetHostStr(search_host); | 596 replacements.SetHostStr(search_host); |
| 599 replacements.SetPortStr(search_port); | 597 replacements.SetPortStr(search_port); |
| 600 return instant_url.ReplaceComponents(replacements); | 598 return instant_url.ReplaceComponents(replacements); |
| 601 } | 599 } |
| 602 | 600 |
| 603 bool MatchesOriginAndPath(const GURL& my_url, const GURL& other_url) { | 601 bool MatchesOriginAndPath(const GURL& my_url, const GURL& other_url) { |
| 604 return MatchesOrigin(my_url, other_url) && my_url.path() == other_url.path(); | 602 return MatchesOrigin(my_url, other_url) && my_url.path() == other_url.path(); |
| 605 } | 603 } |
| 606 | 604 |
| 607 } // namespace chrome | 605 } // namespace chrome |
| OLD | NEW |