Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAILING_CONTEXT_H_ | |
| 6 #define CHROME_BROWSER_THUMBNAILS_THUMBNAILING_CONTEXT_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "chrome/common/thumbnail_score.h" | |
| 11 #include "content/public/browser/web_contents.h" | |
| 12 | |
| 13 namespace thumbnails { | |
| 14 | |
| 15 // The result of clipping. This can be used to determine if the | |
| 16 // generated thumbnail is good or not. | |
| 17 enum ClipResult { | |
| 18 // Clipping is not done yet. | |
| 19 kUnprocessed, | |
|
sky
2013/01/17 20:18:36
chrome style is enums should be CAPS_CASE.
motek.
2013/01/18 18:38:41
Done.
| |
| 20 // The source image is smaller. | |
| 21 kSourceIsSmaller, | |
| 22 // Wider than tall by twice or more, clip horizontally. | |
| 23 kTooWiderThanTall, | |
| 24 // Wider than tall, clip horizontally. | |
| 25 kWiderThanTall, | |
| 26 // Taller than wide, clip vertically. | |
| 27 kTallerThanWide, | |
| 28 // The source and destination aspect ratios are identical. | |
| 29 kNotClipped, | |
| 30 }; | |
| 31 | |
| 32 // Holds the information needed for processing a thumbnail. | |
| 33 struct ThumbnailingContext : base::RefCountedThreadSafe<ThumbnailingContext> { | |
|
sky
2013/01/17 20:18:36
Why does this need to be RefCountedThreadSafe? If
motek.
2013/01/18 18:38:41
Right. I copied it from elsewhere, without thinkin
| |
| 34 ThumbnailingContext(content::WebContents* web_contents, | |
| 35 bool load_interrupted); | |
| 36 | |
| 37 content::BrowserContext* browser_context; | |
| 38 GURL url; | |
| 39 ClipResult clip_result; | |
| 40 ThumbnailScore score; | |
| 41 | |
| 42 private: | |
| 43 ~ThumbnailingContext(); | |
| 44 friend class base::RefCountedThreadSafe<ThumbnailingContext>; | |
| 45 }; | |
| 46 | |
| 47 } | |
| 48 | |
| 49 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAILING_CONTEXT_H_ | |
| OLD | NEW |