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

Side by Side Diff: components/history/core/common/thumbnail_score.cc

Issue 304273010: Move thumbnail to history component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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) 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
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 }
OLDNEW
« components/history.gypi ('K') | « components/history/core/common/thumbnail_score.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698