OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_THUMBNAILING_ALGORITHM_H_ | 5 #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAILING_ALGORITHM_H_ |
6 #define CHROME_BROWSER_THUMBNAILS_THUMBNAILING_ALGORITHM_H_ | 6 #define CHROME_BROWSER_THUMBNAILS_THUMBNAILING_ALGORITHM_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "chrome/browser/thumbnails/thumbnailing_context.h" | 9 #include "chrome/browser/thumbnails/thumbnailing_context.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 gfx::Size* target_size) const = 0; | 34 gfx::Size* target_size) const = 0; |
35 | 35 |
36 // Invoked to produce a thumbnail image from a |bitmap| extracted by the | 36 // Invoked to produce a thumbnail image from a |bitmap| extracted by the |
37 // callee from source canvas according to instructions provided by a call | 37 // callee from source canvas according to instructions provided by a call |
38 // to GetCanvasCopyInfo. | 38 // to GetCanvasCopyInfo. |
39 // Note that ProcessBitmap must be able to handle bitmaps which might have not | 39 // Note that ProcessBitmap must be able to handle bitmaps which might have not |
40 // been processed (scalled/cropped) as requested. |context| gives additional | 40 // been processed (scalled/cropped) as requested. |context| gives additional |
41 // information on the source, including if and how it was clipped. | 41 // information on the source, including if and how it was clipped. |
42 // The function shall invoke |callback| once done, passing in fully populated | 42 // The function shall invoke |callback| once done, passing in fully populated |
43 // |context| along with resulting thumbnail bitmap. | 43 // |context| along with resulting thumbnail bitmap. |
44 virtual void ProcessBitmap(ThumbnailingContext* context, | 44 virtual void ProcessBitmap(scoped_refptr<ThumbnailingContext> context, |
45 const ConsumerCallback& callback, | 45 const ConsumerCallback& callback, |
46 const SkBitmap& bitmap) = 0; | 46 const SkBitmap& bitmap) = 0; |
47 | 47 |
48 protected: | 48 protected: |
49 virtual ~ThumbnailingAlgorithm() {} | 49 virtual ~ThumbnailingAlgorithm() {} |
50 friend class base::RefCountedThreadSafe<ThumbnailingAlgorithm>; | 50 friend class base::RefCountedThreadSafe<ThumbnailingAlgorithm>; |
51 }; | 51 }; |
52 | 52 |
53 } | 53 } |
54 | 54 |
55 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAILING_ALGORITHM_H_ | 55 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAILING_ALGORITHM_H_ |
OLD | NEW |