| 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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 // Extended mode instant requires a search terms replacement key. | 744 // Extended mode instant requires a search terms replacement key. |
| 745 return instant_url.is_valid() && | 745 return instant_url.is_valid() && |
| 746 (!IsInstantExtendedAPIEnabled() || | 746 (!IsInstantExtendedAPIEnabled() || |
| 747 template_url->HasSearchTermsReplacementKey(instant_url)); | 747 template_url->HasSearchTermsReplacementKey(instant_url)); |
| 748 } | 748 } |
| 749 | 749 |
| 750 void ResetInstantExtendedOptInStateGateForTest() { | 750 void ResetInstantExtendedOptInStateGateForTest() { |
| 751 instant_extended_opt_in_state_gate = false; | 751 instant_extended_opt_in_state_gate = false; |
| 752 } | 752 } |
| 753 | 753 |
| 754 bool AreMostVisitedItemsEqual( | |
| 755 const std::vector<InstantMostVisitedItem>& items_a, | |
| 756 const std::vector<InstantMostVisitedItem>& items_b) { | |
| 757 if (items_a.size() != items_b.size()) | |
| 758 return false; | |
| 759 | |
| 760 for (size_t i = 0; i < items_b.size(); ++i) { | |
| 761 if (items_b[i].url != items_a[i].url || | |
| 762 items_b[i].title != items_a[i].title) { | |
| 763 return false; | |
| 764 } | |
| 765 } | |
| 766 return true; | |
| 767 } | |
| 768 | |
| 769 } // namespace chrome | 754 } // namespace chrome |
| OLD | NEW |