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

Side by Side Diff: components/ntp_tiles/most_visited_sites.cc

Issue 2478573004: Convert GURL::{host,path} to GURL::{host_piece,path_piece} for ==. (Closed)
Patch Set: rebase to #431874 Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/ntp_tiles/most_visited_sites.h" 5 #include "components/ntp_tiles/most_visited_sites.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 base::CompareCase::INSENSITIVE_ASCII); 69 base::CompareCase::INSENSITIVE_ASCII);
70 } 70 }
71 71
72 // Determine whether we need any tiles from PopularSites to fill up a grid of 72 // Determine whether we need any tiles from PopularSites to fill up a grid of
73 // |num_tiles| tiles. 73 // |num_tiles| tiles.
74 bool NeedPopularSites(const PrefService* prefs, int num_tiles) { 74 bool NeedPopularSites(const PrefService* prefs, int num_tiles) {
75 return prefs->GetInteger(prefs::kNumPersonalTiles) < num_tiles; 75 return prefs->GetInteger(prefs::kNumPersonalTiles) < num_tiles;
76 } 76 }
77 77
78 bool AreURLsEquivalent(const GURL& url1, const GURL& url2) { 78 bool AreURLsEquivalent(const GURL& url1, const GURL& url2) {
79 return url1.host() == url2.host() && url1.path() == url2.path(); 79 return url1.host_piece() == url2.host_piece() &&
80 url1.path_piece() == url2.path_piece();
80 } 81 }
81 82
82 } // namespace 83 } // namespace
83 84
84 MostVisitedSites::MostVisitedSites(PrefService* prefs, 85 MostVisitedSites::MostVisitedSites(PrefService* prefs,
85 scoped_refptr<history::TopSites> top_sites, 86 scoped_refptr<history::TopSites> top_sites,
86 SuggestionsService* suggestions, 87 SuggestionsService* suggestions,
87 std::unique_ptr<PopularSites> popular_sites, 88 std::unique_ptr<PopularSites> popular_sites,
88 std::unique_ptr<IconCacher> icon_cacher, 89 std::unique_ptr<IconCacher> icon_cacher,
89 MostVisitedSitesSupervisor* supervisor) 90 MostVisitedSitesSupervisor* supervisor)
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 435
435 void MostVisitedSites::TopSitesChanged(TopSites* top_sites, 436 void MostVisitedSites::TopSitesChanged(TopSites* top_sites,
436 ChangeReason change_reason) { 437 ChangeReason change_reason) {
437 if (mv_source_ == NTPTileSource::TOP_SITES) { 438 if (mv_source_ == NTPTileSource::TOP_SITES) {
438 // The displayed tiles are invalidated. 439 // The displayed tiles are invalidated.
439 InitiateTopSitesQuery(); 440 InitiateTopSitesQuery();
440 } 441 }
441 } 442 }
442 443
443 } // namespace ntp_tiles 444 } // namespace ntp_tiles
OLDNEW
« no previous file with comments | « components/history/core/browser/url_utils.cc ('k') | components/omnibox/browser/history_url_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698