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

Side by Side Diff: chrome/browser/tab_contents/thumbnail_generator.cc

Issue 6813040: Add TopSites::GetTemporaryThumbnailScore(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/top_sites_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/tab_contents/thumbnail_generator.h" 5 #include "chrome/browser/tab_contents/thumbnail_generator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 const GURL& url) { 664 const GURL& url) {
665 if (!profile || !top_sites) 665 if (!profile || !top_sites)
666 return false; 666 return false;
667 // Skip if it's in the incognito mode. 667 // Skip if it's in the incognito mode.
668 if (profile->IsOffTheRecord()) 668 if (profile->IsOffTheRecord())
669 return false; 669 return false;
670 // Skip if the given URL is not appropriate for history. 670 // Skip if the given URL is not appropriate for history.
671 if (!HistoryService::CanAddURL(url)) 671 if (!HistoryService::CanAddURL(url))
672 return false; 672 return false;
673 // Skip if the top sites list is full, and the URL is not known. 673 // Skip if the top sites list is full, and the URL is not known.
674 const bool is_known = top_sites->IsKnownURL(url); 674 if (top_sites->IsFull() && !top_sites->IsKnownURL(url))
675 if (top_sites->IsFull() && !is_known)
676 return false; 675 return false;
677 // Skip if we don't have to udpate the existing thumbnail. 676 // Skip if we don't have to udpate the existing thumbnail.
678 ThumbnailScore current_score; 677 ThumbnailScore current_score;
679 if (is_known && 678 if (top_sites->GetPageThumbnailScore(url, &current_score) &&
680 top_sites->GetPageThumbnailScore(url, &current_score) &&
681 !current_score.ShouldConsiderUpdating()) 679 !current_score.ShouldConsiderUpdating())
682 return false; 680 return false;
681 // Skip if we don't have to udpate the temporary thumbnail (i.e. the one
682 // not yet saved).
683 ThumbnailScore temporary_score;
684 if (top_sites->GetTemporaryPageThumbnailScore(url, &temporary_score) &&
685 !temporary_score.ShouldConsiderUpdating())
686 return false;
683 687
684 return true; 688 return true;
685 } 689 }
OLDNEW
« no previous file with comments | « chrome/browser/history/top_sites_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698