1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_
10 #include "base/callback.h"
11 #include "base/files/file_path.h"
12 #include "chrome/browser/icon_loader.h"
14 // Helper class for DownloadsGetFileIconFunction. Only used for a single icon
16 class DownloadFileIconExtractor
{
18 // Callback for |ExtractIconForPath|. The parameter is a URL as a string for a
19 // suitable icon. The string could be empty if the icon could not be
21 typedef base::Callback
<void(const std::string
&)> IconURLCallback
;
23 virtual ~DownloadFileIconExtractor() {}
25 // Should return false if the request was invalid. If the return value is
26 // true, then |callback| should be called with the result.
27 virtual bool ExtractIconURLForPath(const base::FilePath
& path
,
29 IconLoader::IconSize icon_size
,
30 IconURLCallback callback
) = 0;
33 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_