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

Side by Side Diff: chrome/browser/history/top_sites_impl.cc

Issue 839193002: Move ServiceAccessType into //components/keyed_service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on android Created 5 years, 11 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/history/top_sites_impl.h" 5 #include "chrome/browser/history/top_sites_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 delta->deleted.push_back(old_list[i->second]); 443 delta->deleted.push_back(old_list[i->second]);
444 } 444 }
445 } 445 }
446 446
447 base::CancelableTaskTracker::TaskId TopSitesImpl::StartQueryForMostVisited() { 447 base::CancelableTaskTracker::TaskId TopSitesImpl::StartQueryForMostVisited() {
448 DCHECK(loaded_); 448 DCHECK(loaded_);
449 if (!profile_) 449 if (!profile_)
450 return base::CancelableTaskTracker::kBadTaskId; 450 return base::CancelableTaskTracker::kBadTaskId;
451 451
452 HistoryService* hs = HistoryServiceFactory::GetForProfile( 452 HistoryService* hs = HistoryServiceFactory::GetForProfile(
453 profile_, Profile::EXPLICIT_ACCESS); 453 profile_, ServiceAccessType::EXPLICIT_ACCESS);
454 // |hs| may be null during unit tests. 454 // |hs| may be null during unit tests.
455 if (hs) { 455 if (hs) {
456 return hs->QueryMostVisitedURLs( 456 return hs->QueryMostVisitedURLs(
457 num_results_to_request_from_history(), 457 num_results_to_request_from_history(),
458 kDaysOfHistory, 458 kDaysOfHistory,
459 base::Bind(&TopSitesImpl::OnTopSitesAvailableFromHistory, 459 base::Bind(&TopSitesImpl::OnTopSitesAvailableFromHistory,
460 base::Unretained(this)), 460 base::Unretained(this)),
461 &cancelable_task_tracker_); 461 &cancelable_task_tracker_);
462 } 462 }
463 return base::CancelableTaskTracker::kBadTaskId; 463 return base::CancelableTaskTracker::kBadTaskId;
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 base::TimeDelta::FromSeconds(kUpdateIntervalSecs)); 919 base::TimeDelta::FromSeconds(kUpdateIntervalSecs));
920 } 920 }
921 921
922 void TopSitesImpl::OnTopSitesAvailableFromHistory( 922 void TopSitesImpl::OnTopSitesAvailableFromHistory(
923 const MostVisitedURLList* pages) { 923 const MostVisitedURLList* pages) {
924 DCHECK(pages); 924 DCHECK(pages);
925 SetTopSites(*pages); 925 SetTopSites(*pages);
926 } 926 }
927 927
928 } // namespace history 928 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/redirect_browsertest.cc ('k') | chrome/browser/history/top_sites_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698