OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "chrome/browser/history/top_sites.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 } | 939 } |
940 | 940 |
941 void TopSites::RestartQueryForTopSitesTimer(base::TimeDelta delta) { | 941 void TopSites::RestartQueryForTopSitesTimer(base::TimeDelta delta) { |
942 if (timer_.IsRunning() && ((timer_start_time_ + timer_.GetCurrentDelay()) < | 942 if (timer_.IsRunning() && ((timer_start_time_ + timer_.GetCurrentDelay()) < |
943 (base::TimeTicks::Now() + delta))) { | 943 (base::TimeTicks::Now() + delta))) { |
944 return; | 944 return; |
945 } | 945 } |
946 | 946 |
947 timer_start_time_ = base::TimeTicks::Now(); | 947 timer_start_time_ = base::TimeTicks::Now(); |
948 timer_.Stop(); | 948 timer_.Stop(); |
949 timer_.Start(FROM_HERE, delta, this, &TopSites::TimerFired); | 949 timer_.Start(delta, this, &TopSites::TimerFired); |
950 } | 950 } |
951 | 951 |
952 void TopSites::OnHistoryMigrationWrittenToDisk(TopSitesBackend::Handle handle) { | 952 void TopSites::OnHistoryMigrationWrittenToDisk(TopSitesBackend::Handle handle) { |
953 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 953 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
954 | 954 |
955 if (!profile_) | 955 if (!profile_) |
956 return; | 956 return; |
957 | 957 |
958 HistoryService* history = | 958 HistoryService* history = |
959 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); | 959 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 SetTopSites(pages); | 1006 SetTopSites(pages); |
1007 | 1007 |
1008 // Used only in testing. | 1008 // Used only in testing. |
1009 NotificationService::current()->Notify( | 1009 NotificationService::current()->Notify( |
1010 chrome::NOTIFICATION_TOP_SITES_UPDATED, | 1010 chrome::NOTIFICATION_TOP_SITES_UPDATED, |
1011 Source<TopSites>(this), | 1011 Source<TopSites>(this), |
1012 Details<CancelableRequestProvider::Handle>(&handle)); | 1012 Details<CancelableRequestProvider::Handle>(&handle)); |
1013 } | 1013 } |
1014 | 1014 |
1015 } // namespace history | 1015 } // namespace history |
OLD | NEW |