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

Unified Diff: chrome/browser/ui/app_list/search/app_result.cc

Issue 789623003: Use base::Clock instead of base::Time::Now in AppSearchProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@now_source
Patch Set: rebase Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/search/app_result.cc
diff --git a/chrome/browser/ui/app_list/search/app_result.cc b/chrome/browser/ui/app_list/search/app_result.cc
index ae0166af362a79a9508a78b45ed708fff8f20dc5..74c7055d53f082afee7daae1debbb8f38e9eb0c1 100644
--- a/chrome/browser/ui/app_list/search/app_result.cc
+++ b/chrome/browser/ui/app_list/search/app_result.cc
@@ -81,7 +81,11 @@ void AppResult::UpdateFromMatch(const TokenizedString& title,
void AppResult::UpdateFromLastLaunched(const base::Time& current_time,
const base::Time& last_launched) {
base::TimeDelta delta = current_time - last_launched;
- DCHECK_LE(0, delta.InSeconds());
+ if (current_time < last_launched) {
Matt Giuca 2014/12/10 07:16:12 This certainly needs an explanation. (From the bug
calamity 2014/12/11 05:05:01 Done.
+ set_relevance(1.0);
+ return;
+ }
+
const int kSecondsInWeek = 60 * 60 * 24 * 7;
// Set the relevance to a value between 0 and 1. This function decays as the

Powered by Google App Engine
This is Rietveld 408576698