| 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/browser/thumbnails/thumbnail_service_impl.h" | 5 #include "chrome/browser/thumbnails/thumbnail_service_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "chrome/browser/history/history_service.h" | 10 #include "chrome/browser/history/history_service.h" |
| 11 #include "chrome/browser/thumbnails/content_based_thumbnailing_algorithm.h" | 11 #include "chrome/browser/thumbnails/content_based_thumbnailing_algorithm.h" |
| 12 #include "chrome/browser/thumbnails/simple_thumbnail_crop.h" | 12 #include "chrome/browser/thumbnails/simple_thumbnail_crop.h" |
| 13 #include "chrome/browser/thumbnails/thumbnailing_context.h" | 13 #include "chrome/browser/thumbnails/thumbnailing_context.h" |
| 14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 #include "components/search/search.h" | 15 #include "components/search/search.h" |
| 16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 17 | 17 |
| 18 using content::BrowserThread; | 18 using content::BrowserThread; |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // The thumbnail size in DIP. | 22 // The thumbnail size in DIP. |
| 23 const int kThumbnailWidth = 212; | 23 const int kThumbnailWidth = 212; |
| 24 const int kThumbnailHeight = 132; | 24 const int kThumbnailHeight = 142; |
| 25 | 25 |
| 26 // True if thumbnail retargeting feature is enabled (Finch/flags). | 26 // True if thumbnail retargeting feature is enabled (Finch/flags). |
| 27 bool IsThumbnailRetargetingEnabled() { | 27 bool IsThumbnailRetargetingEnabled() { |
| 28 if (!chrome::IsInstantExtendedAPIEnabled()) | 28 if (!chrome::IsInstantExtendedAPIEnabled()) |
| 29 return false; | 29 return false; |
| 30 | 30 |
| 31 return CommandLine::ForCurrentProcess()->HasSwitch( | 31 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 32 switches::kEnableThumbnailRetargeting); | 32 switches::kEnableThumbnailRetargeting); |
| 33 } | 33 } |
| 34 | 34 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 void ThumbnailServiceImpl::ShutdownOnUIThread() { | 120 void ThumbnailServiceImpl::ShutdownOnUIThread() { |
| 121 // Since each call uses its own scoped_refptr, we can just clear the reference | 121 // Since each call uses its own scoped_refptr, we can just clear the reference |
| 122 // here by assigning null. If another call is completed, it added its own | 122 // here by assigning null. If another call is completed, it added its own |
| 123 // reference. | 123 // reference. |
| 124 top_sites_ = NULL; | 124 top_sites_ = NULL; |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace thumbnails | 127 } // namespace thumbnails |
| OLD | NEW |