| 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/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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
| 25 #include "skia/ext/bitmap_platform_device.h" | 25 #include "skia/ext/bitmap_platform_device.h" |
| 26 #include "skia/ext/image_operations.h" | 26 #include "skia/ext/image_operations.h" |
| 27 #include "skia/ext/platform_canvas.h" | 27 #include "skia/ext/platform_canvas.h" |
| 28 #include "third_party/skia/include/core/SkBitmap.h" | 28 #include "third_party/skia/include/core/SkBitmap.h" |
| 29 #include "ui/gfx/color_utils.h" | 29 #include "ui/gfx/color_utils.h" |
| 30 #include "ui/gfx/rect.h" | 30 #include "ui/gfx/rect.h" |
| 31 #include "ui/gfx/skbitmap_operations.h" | 31 #include "ui/gfx/skbitmap_operations.h" |
| 32 | 32 |
| 33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
| 34 #include "chrome/common/section_util_win.h" | 34 #include "content/common/section_util_win.h" |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 // Overview | 37 // Overview |
| 38 // -------- | 38 // -------- |
| 39 // This class provides current thumbnails for tabs. The simplest operation is | 39 // This class provides current thumbnails for tabs. The simplest operation is |
| 40 // when a request for a thumbnail comes in, to grab the backing store and make | 40 // when a request for a thumbnail comes in, to grab the backing store and make |
| 41 // a smaller version of that. | 41 // a smaller version of that. |
| 42 // | 42 // |
| 43 // A complication happens because we don't always have nice backing stores for | 43 // A complication happens because we don't always have nice backing stores for |
| 44 // all tabs (there is a cache of several tabs we'll keep backing stores for). | 44 // all tabs (there is a cache of several tabs we'll keep backing stores for). |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 return false; | 676 return false; |
| 677 // Skip if we don't have to udpate the existing thumbnail. | 677 // Skip if we don't have to udpate the existing thumbnail. |
| 678 ThumbnailScore current_score; | 678 ThumbnailScore current_score; |
| 679 if (is_known && | 679 if (is_known && |
| 680 top_sites->GetPageThumbnailScore(url, ¤t_score) && | 680 top_sites->GetPageThumbnailScore(url, ¤t_score) && |
| 681 !current_score.ShouldConsiderUpdating()) | 681 !current_score.ShouldConsiderUpdating()) |
| 682 return false; | 682 return false; |
| 683 | 683 |
| 684 return true; | 684 return true; |
| 685 } | 685 } |
| OLD | NEW |