summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/drag_download_util.h
blob: 7f2a85375b246cc2958e2dc3a009d079d844a0e5 (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
// Copyright (c) 2010 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_DRAG_DOWNLOAD_UTIL_H_
#define CHROME_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_UTIL_H_

#include "base/basictypes.h"
#include "base/file_path.h"

class GURL;

namespace drag_download_util {

// Parse the download metadata set in DataTransfer.setData. The metadata
// consists of a set of the following values separated by ":"
// * MIME type
// * File name
// * URL
// For example, we can have
//   text/plain:example.txt:http://example.com/example.txt
bool ParseDownloadMetadata(const string16& metadata,
                           string16* mime_type,
                           FilePath* file_name,
                           GURL* url);

}  // namespace drag_download_util

#endif  // CHROME_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_UTIL_H_