summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_file_icon_extractor.h
blob: f40effc5ded2299e4774ed9e473092750514da61 (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
// Copyright (c) 2012 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 CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_
#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_

#include <string>

#include "base/callback.h"
#include "base/file_path.h"
#include "chrome/browser/icon_loader.h"

// Helper class for DownloadsGetFileIconFunction. Only used for a single icon
// extraction.
class DownloadFileIconExtractor {
 public:
  // Callback for |ExtractIconForPath|. The parameter is a URL as a string for a
  // suitable icon. The string could be empty if the icon could not be
  // determined.
  typedef base::Callback<void(const std::string&)> IconURLCallback;

  virtual ~DownloadFileIconExtractor() {}

  // Should return false if the request was invalid.  If the return value is
  // true, then |callback| should be called with the result.
  virtual bool ExtractIconURLForPath(const FilePath& path,
                                     IconLoader::IconSize icon_size,
                                     IconURLCallback callback) = 0;
};

#endif  // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_