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

Side by Side Diff: chrome/browser/download/download_file_icon_extractor.h

Issue 137043005: Fix chrome.downloads.getFileIcon for hi-dpi and clarify docs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 6 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/downloads/downloads_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_ 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "chrome/browser/icon_loader.h" 12 #include "chrome/browser/icon_loader.h"
13 13
14 // Helper class for DownloadsGetFileIconFunction. Only used for a single icon 14 // Helper class for DownloadsGetFileIconFunction. Only used for a single icon
15 // extraction. 15 // extraction.
16 class DownloadFileIconExtractor { 16 class DownloadFileIconExtractor {
17 public: 17 public:
18 // Callback for |ExtractIconForPath|. The parameter is a URL as a string for a 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 19 // suitable icon. The string could be empty if the icon could not be
20 // determined. 20 // determined.
21 typedef base::Callback<void(const std::string&)> IconURLCallback; 21 typedef base::Callback<void(const std::string&)> IconURLCallback;
22 22
23 virtual ~DownloadFileIconExtractor() {} 23 virtual ~DownloadFileIconExtractor() {}
24 24
25 // Should return false if the request was invalid. If the return value is 25 // Should return false if the request was invalid. If the return value is
26 // true, then |callback| should be called with the result. 26 // true, then |callback| should be called with the result.
27 virtual bool ExtractIconURLForPath(const base::FilePath& path, 27 virtual bool ExtractIconURLForPath(const base::FilePath& path,
28 float scale,
28 IconLoader::IconSize icon_size, 29 IconLoader::IconSize icon_size,
29 IconURLCallback callback) = 0; 30 IconURLCallback callback) = 0;
30 }; 31 };
31 32
32 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_ 33 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_ICON_EXTRACTOR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/downloads/downloads_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698