Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / download / download_file_icon_extractor.h
blob454790a23c9a5086cd6963944b53196ff7af7255
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_
8 #include <string>
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
15 // extraction.
16 class DownloadFileIconExtractor {
17 public:
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
20 // determined.
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,
28 float scale,
29 IconLoader::IconSize icon_size,
30 IconURLCallback callback) = 0;
33 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_