Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: chrome/browser/thumbnails/thumbnailing_context.h

Issue 11985003: Refactored-out the code of thumbnaling algorithm from thumbnail_tab_helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another round of updates from OWNER's review. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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/browser/thumbnails/thumbnail_service.h"
11 #include "chrome/common/thumbnail_score.h"
12 #include "content/public/browser/web_contents.h"
13
14 namespace thumbnails {
15
16 // The result of clipping. This can be used to determine if the
17 // generated thumbnail is good or not.
18 enum ClipResult {
19 // Clipping is not done yet.
20 CLIP_RESULT_UNPROCESSED,
21 // The source image is smaller.
22 CLIP_RESULT_SOURCE_IS_SMALLER,
23 // Wider than tall by twice or more, clip horizontally.
24 CLIP_RESULT_MUCH_WIDER_THAN_TALL,
25 // Wider than tall, clip horizontally.
26 CLIP_RESULT_WIDER_THAN_TALL,
27 // Taller than wide, clip vertically.
28 CLIP_RESULT_TALLER_THAN_WIDE,
29 // The source and destination aspect ratios are identical.
30 CLIP_RESULT_NOT_CLIPPED,
31 };
32
33 // Holds the information needed for processing a thumbnail.
34 struct ThumbnailingContext : base::RefCountedThreadSafe<ThumbnailingContext> {
35 ThumbnailingContext(content::WebContents* web_contents,
36 ThumbnailService* receiving_service,
37 bool load_interrupted);
38
39 scoped_refptr<ThumbnailService> service;
40 GURL url;
41 ClipResult clip_result;
42 ThumbnailScore score;
43
44 private:
45 ~ThumbnailingContext();
46 friend class base::RefCountedThreadSafe<ThumbnailingContext>;
47 };
48
49 }
50
51 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAILING_CONTEXT_H_
OLDNEW
« no previous file with comments | « chrome/browser/thumbnails/thumbnailing_algorithm.h ('k') | chrome/browser/thumbnails/thumbnailing_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698