OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/common/thumbnail_score.h" | 5 #include "components/history/core/common/thumbnail_score.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 | 9 |
10 using base::Time; | 10 using base::Time; |
11 using base::TimeDelta; | 11 using base::TimeDelta; |
12 | 12 |
13 const int64 ThumbnailScore::kUpdateThumbnailTimeDays = 1; | 13 const int64 ThumbnailScore::kUpdateThumbnailTimeDays = 1; |
14 const double ThumbnailScore::kThumbnailMaximumBoringness = 0.94; | 14 const double ThumbnailScore::kThumbnailMaximumBoringness = 0.94; |
15 const double ThumbnailScore::kThumbnailDegradePerHour = 0.01; | 15 const double ThumbnailScore::kThumbnailDegradePerHour = 0.01; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 bool ThumbnailScore::ShouldConsiderUpdating() { | 131 bool ThumbnailScore::ShouldConsiderUpdating() { |
132 const TimeDelta time_elapsed = Time::Now() - time_at_snapshot; | 132 const TimeDelta time_elapsed = Time::Now() - time_at_snapshot; |
133 if (time_elapsed < TimeDelta::FromDays(kUpdateThumbnailTimeDays) && | 133 if (time_elapsed < TimeDelta::FromDays(kUpdateThumbnailTimeDays) && |
134 good_clipping && at_top && load_completed) { | 134 good_clipping && at_top && load_completed) { |
135 // The current thumbnail is new and has good properties. | 135 // The current thumbnail is new and has good properties. |
136 return false; | 136 return false; |
137 } | 137 } |
138 // The current thumbnail should be updated. | 138 // The current thumbnail should be updated. |
139 return true; | 139 return true; |
140 } | 140 } |
OLD | NEW |