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

Side by Side Diff: chrome/browser/search/search.cc

Issue 17521002: Added a check in Searchbox::OnMostVisitedChanged() to prevent duplicate notifications regarding mos… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
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 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 // Extended mode instant requires a search terms replacement key. 733 // Extended mode instant requires a search terms replacement key.
734 return instant_url.is_valid() && 734 return instant_url.is_valid() &&
735 (!IsInstantExtendedAPIEnabled() || 735 (!IsInstantExtendedAPIEnabled() ||
736 template_url->HasSearchTermsReplacementKey(instant_url)); 736 template_url->HasSearchTermsReplacementKey(instant_url));
737 } 737 }
738 738
739 void ResetInstantExtendedOptInStateGateForTest() { 739 void ResetInstantExtendedOptInStateGateForTest() {
740 instant_extended_opt_in_state_gate = false; 740 instant_extended_opt_in_state_gate = false;
741 } 741 }
742 742
743 bool AreMostVisitedItemsEqual(
744 const std::vector<InstantMostVisitedItem>& items_a,
745 const std::vector<InstantMostVisitedItem>& items_b) {
746 if (items_a.size() != items_b.size())
747 return false;
748
749 for (size_t i = 0; i < items_b.size(); ++i) {
750 if (items_b[i].url != items_a[i].url ||
751 items_b[i].title != items_a[i].title) {
752 return false;
753 }
754 }
755 return true;
756 }
757
758 } // namespace chrome 743 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698