OLD | NEW |
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 #include "ui/base/dragdrop/os_exchange_data.h" | 5 #include "ui/base/dragdrop/os_exchange_data.h" |
6 | 6 |
7 #include "base/pickle.h" | 7 #include "base/pickle.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h" |
9 #include "url/gurl.h" | 10 #include "url/gurl.h" |
10 | 11 |
11 namespace ui { | 12 namespace ui { |
12 | 13 |
13 OSExchangeData::DownloadFileInfo::DownloadFileInfo( | 14 OSExchangeData::DownloadFileInfo::DownloadFileInfo( |
14 const base::FilePath& filename, | 15 const base::FilePath& filename, |
15 DownloadFileProvider* downloader) | 16 DownloadFileProvider* downloader) |
16 : filename(filename), | 17 : filename(filename), |
17 downloader(downloader) { | 18 downloader(downloader) { |
18 } | 19 } |
19 | 20 |
20 OSExchangeData::DownloadFileInfo::~DownloadFileInfo() {} | 21 OSExchangeData::DownloadFileInfo::~DownloadFileInfo() {} |
21 | 22 |
22 OSExchangeData::OSExchangeData() : provider_(CreateProvider()) { | 23 OSExchangeData::OSExchangeData() |
| 24 : provider_(OSExchangeDataProviderFactory::CreateProvider()) { |
23 } | 25 } |
24 | 26 |
25 OSExchangeData::OSExchangeData(Provider* provider) : provider_(provider) { | 27 OSExchangeData::OSExchangeData(std::unique_ptr<Provider> provider) |
| 28 : provider_(std::move(provider)) { |
26 } | 29 } |
27 | 30 |
28 OSExchangeData::~OSExchangeData() { | 31 OSExchangeData::~OSExchangeData() { |
29 } | 32 } |
30 | 33 |
31 void OSExchangeData::MarkOriginatedFromRenderer() { | 34 void OSExchangeData::MarkOriginatedFromRenderer() { |
32 provider_->MarkOriginatedFromRenderer(); | 35 provider_->MarkOriginatedFromRenderer(); |
33 } | 36 } |
34 | 37 |
35 bool OSExchangeData::DidOriginateFromRenderer() const { | 38 bool OSExchangeData::DidOriginateFromRenderer() const { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 void OSExchangeData::SetHtml(const base::string16& html, const GURL& base_url) { | 145 void OSExchangeData::SetHtml(const base::string16& html, const GURL& base_url) { |
143 provider_->SetHtml(html, base_url); | 146 provider_->SetHtml(html, base_url); |
144 } | 147 } |
145 | 148 |
146 bool OSExchangeData::GetHtml(base::string16* html, GURL* base_url) const { | 149 bool OSExchangeData::GetHtml(base::string16* html, GURL* base_url) const { |
147 return provider_->GetHtml(html, base_url); | 150 return provider_->GetHtml(html, base_url); |
148 } | 151 } |
149 #endif | 152 #endif |
150 | 153 |
151 } // namespace ui | 154 } // namespace ui |
OLD | NEW |