diff options
author | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-09 19:38:02 +0000 |
---|---|---|
committer | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-09 19:38:02 +0000 |
commit | 45e4fab2ec46c7a3ebe6476f5a6d25f2aaf1e4cf (patch) | |
tree | aae06a3d01902d89c562d4a32a4771302f267c08 /chrome/browser/download/download_file_icon_extractor.h | |
parent | 431b5cd77b2985869e33bf31d7eccd479a2a5372 (diff) | |
download | chromium_src-45e4fab2ec46c7a3ebe6476f5a6d25f2aaf1e4cf.zip chromium_src-45e4fab2ec46c7a3ebe6476f5a6d25f2aaf1e4cf.tar.gz chromium_src-45e4fab2ec46c7a3ebe6476f5a6d25f2aaf1e4cf.tar.bz2 |
Implement chrome.experimental.downloads.getFileIcon().
BUG=12133
TEST=browser_tests --gtest_filter=DownloadExtensionTest.*:DownloadsApiTest.*
Review URL: http://codereview.chromium.org/8519004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116898 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_file_icon_extractor.h')
-rw-r--r-- | chrome/browser/download/download_file_icon_extractor.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/chrome/browser/download/download_file_icon_extractor.h b/chrome/browser/download/download_file_icon_extractor.h new file mode 100644 index 0000000..6543ae9 --- /dev/null +++ b/chrome/browser/download/download_file_icon_extractor.h @@ -0,0 +1,33 @@ +// 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_ +#pragma once + +#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_ |