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

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
« no previous file with comments | « chrome/browser/search/search.h ('k') | chrome/browser/ui/search/instant_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « chrome/browser/search/search.h ('k') | chrome/browser/ui/search/instant_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698