OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/public/common/drop_data.h" | 5 #include "content/public/common/drop_data.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 DropData::DropData() | 9 DropData::DropData() |
10 : did_originate_from_renderer(false), | 10 : did_originate_from_renderer(false), |
| 11 has_url(false), |
11 referrer_policy(blink::WebReferrerPolicyDefault), | 12 referrer_policy(blink::WebReferrerPolicyDefault), |
12 key_modifiers(0) {} | 13 key_modifiers(0) {} |
13 | 14 |
14 DropData::DropData(const DropData& other) = default; | 15 DropData::DropData(const DropData& other) = default; |
15 | 16 |
16 DropData::~DropData() { | 17 DropData::~DropData() { |
17 } | 18 } |
18 | 19 |
| 20 DropData::Metadata::Metadata() {} |
| 21 |
| 22 // static |
| 23 DropData::Metadata DropData::Metadata::CreateForMimeType( |
| 24 const Kind& kind, |
| 25 const base::string16& mime_type) { |
| 26 Metadata metadata; |
| 27 metadata.kind = kind; |
| 28 metadata.mime_type = mime_type; |
| 29 return metadata; |
| 30 } |
| 31 |
| 32 // static |
| 33 DropData::Metadata DropData::Metadata::CreateForFilePath( |
| 34 const base::FilePath& filename) { |
| 35 Metadata metadata; |
| 36 metadata.kind = Kind::FILENAME; |
| 37 metadata.filename = filename; |
| 38 return metadata; |
| 39 } |
| 40 |
| 41 // static |
| 42 DropData::Metadata DropData::Metadata::CreateForFileSystemUrl( |
| 43 const GURL& file_system_url) { |
| 44 Metadata metadata; |
| 45 metadata.kind = Kind::FILESYSTEMFILE; |
| 46 metadata.file_system_url = file_system_url; |
| 47 return metadata; |
| 48 } |
| 49 |
| 50 DropData::Metadata::Metadata(const DropData::Metadata& other) = default; |
| 51 |
| 52 DropData::Metadata::~Metadata() {} |
| 53 |
19 } // namespace content | 54 } // namespace content |
OLD | NEW |