| 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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 // Extended mode instant requires a search terms replacement key. | 692 // Extended mode instant requires a search terms replacement key. |
| 693 return instant_url.is_valid() && | 693 return instant_url.is_valid() && |
| 694 (!IsInstantExtendedAPIEnabled() || | 694 (!IsInstantExtendedAPIEnabled() || |
| 695 template_url->HasSearchTermsReplacementKey(instant_url)); | 695 template_url->HasSearchTermsReplacementKey(instant_url)); |
| 696 } | 696 } |
| 697 | 697 |
| 698 void ResetInstantExtendedOptInStateGateForTest() { | 698 void ResetInstantExtendedOptInStateGateForTest() { |
| 699 instant_extended_opt_in_state_gate = false; | 699 instant_extended_opt_in_state_gate = false; |
| 700 } | 700 } |
| 701 | 701 |
| 702 bool AreMostVisitedItemsEqual( |
| 703 const std::vector<InstantMostVisitedItem>& new_items, |
| 704 const std::vector<InstantMostVisitedItem>& old_items) { |
| 705 if (new_items.size() != old_items.size()) |
| 706 return false; |
| 707 |
| 708 for (size_t i = 0; i < old_items.size(); ++i) { |
| 709 if (old_items[i].url != new_items[i].url || |
| 710 old_items[i].title != new_items[i].title) |
| 711 return false; |
| 712 } |
| 713 return true; |
| 714 } |
| 715 |
| 702 } // namespace chrome | 716 } // namespace chrome |
| OLD | NEW |