summaryrefslogtreecommitdiffstats
path: root/components/enhanced_bookmarks/image_record.h
blob: e93f3b83ff422f7ff2ee3091c686f0cd912fef82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_ENHANCED_BOOKMARKS_IMAGE_RECORD_H_
#define COMPONENTS_ENHANCED_BOOKMARKS_IMAGE_RECORD_H_

#include "base/memory/ref_counted.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/image/image.h"
#include "url/gurl.h"

namespace enhanced_bookmarks {

// Defines a record of a bookmark image in the ImageStore.
class ImageRecord :  public base::RefCountedThreadSafe<ImageRecord> {
 public:
  ImageRecord(scoped_ptr<gfx::Image> image,
              const GURL& url,
              SkColor dominant_color);
  ImageRecord(scoped_ptr<gfx::Image> image, const GURL& url);
  ImageRecord();

  // The image data.
  scoped_ptr<gfx::Image> image;
  // The URL that hosts the image.
  GURL url;
  // The dominant color of the image.
  SkColor dominant_color;

 private:
  friend class base::RefCountedThreadSafe<ImageRecord>;

  ~ImageRecord();
};

}  // namespace enhanced_bookmarks

#endif  // COMPONENTS_ENHANCED_BOOKMARKS_IMAGE_RECORD_H_