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 #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_H_ |
6 #define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_H_ | 6 #define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_H_ |
7 | 7 |
8 #include "chrome/common/thumbnail_score.h" | 8 #include "chrome/common/thumbnail_score.h" |
9 #include "components/browser_context_keyed_service/refcounted_browser_context_ke
yed_service.h" | 9 #include "components/browser_context_keyed_service/refcounted_browser_context_ke
yed_service.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
11 #include "ui/gfx/image/image.h" | 11 #include "ui/gfx/image/image.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class RefCountedMemory; | 14 class RefCountedMemory; |
15 } | 15 } |
16 | 16 |
17 namespace thumbnails { | 17 namespace thumbnails { |
18 | 18 |
19 class ThumbnailingAlgorithm; | 19 class ThumbnailingAlgorithm; |
20 struct ThumbnailingContext; | 20 struct ThumbnailingContext; |
21 | 21 |
22 // An interface abstracting access to thumbnails. Intended as a temporary | 22 // An interface abstracting access to thumbnails. Intended as a temporary |
23 // bridge facilitating switch from TopSites as the thumbnail source to a more | 23 // bridge facilitating switch from TopSites as the thumbnail source to a more |
24 // robust way of handling these artefacts. | 24 // robust way of handling these artefacts. |
25 class ThumbnailService : public RefcountedProfileKeyedService { | 25 class ThumbnailService : public RefcountedBrowserContextKeyedService { |
26 public: | 26 public: |
27 // Sets the given thumbnail for the given URL. Returns true if the thumbnail | 27 // Sets the given thumbnail for the given URL. Returns true if the thumbnail |
28 // was updated. False means either the URL wasn't known to us, or we felt | 28 // was updated. False means either the URL wasn't known to us, or we felt |
29 // that our current thumbnail was superior to the given one. | 29 // that our current thumbnail was superior to the given one. |
30 virtual bool SetPageThumbnail(const ThumbnailingContext& context, | 30 virtual bool SetPageThumbnail(const ThumbnailingContext& context, |
31 const gfx::Image& thumbnail) = 0; | 31 const gfx::Image& thumbnail) = 0; |
32 | 32 |
33 // Returns the ThumbnailingAlgorithm used for processing thumbnails. | 33 // Returns the ThumbnailingAlgorithm used for processing thumbnails. |
34 // It is always a new instance, the caller owns it. It will encapsulate the | 34 // It is always a new instance, the caller owns it. It will encapsulate the |
35 // process of creating a thumbnail from tab contents. The lifetime of these | 35 // process of creating a thumbnail from tab contents. The lifetime of these |
(...skipping 12 matching lines...) Expand all Loading... |
48 // Returns true if the page thumbnail should be updated. | 48 // Returns true if the page thumbnail should be updated. |
49 virtual bool ShouldAcquirePageThumbnail(const GURL& url) = 0; | 49 virtual bool ShouldAcquirePageThumbnail(const GURL& url) = 0; |
50 | 50 |
51 protected: | 51 protected: |
52 virtual ~ThumbnailService() {} | 52 virtual ~ThumbnailService() {} |
53 }; | 53 }; |
54 | 54 |
55 } | 55 } |
56 | 56 |
57 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_H_ | 57 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_H_ |
OLD | NEW |