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

Side by Side Diff: ui/base/dragdrop/os_exchange_data.cc

Issue 2179813003: Allow OSExchangeData::Provider to be overridden at run time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac + win Created 4 years, 4 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
« no previous file with comments | « ui/base/dragdrop/os_exchange_data.h ('k') | ui/base/dragdrop/os_exchange_data_provider_aura.h » ('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 #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
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
OLDNEW
« no previous file with comments | « ui/base/dragdrop/os_exchange_data.h ('k') | ui/base/dragdrop/os_exchange_data_provider_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698