diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-23 21:42:58 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-23 21:42:58 +0000 |
commit | b6d432335f59500e092de2be4fcf42ed303ae1c5 (patch) | |
tree | 0dae24ec6c0f89442ee37d18aeb17f5dcf48d6e0 /app/os_exchange_data.cc | |
parent | 599ea9fd7f5f029661916c191ff89b7358719f81 (diff) | |
download | chromium_src-b6d432335f59500e092de2be4fcf42ed303ae1c5.zip chromium_src-b6d432335f59500e092de2be4fcf42ed303ae1c5.tar.gz chromium_src-b6d432335f59500e092de2be4fcf42ed303ae1c5.tar.bz2 |
Implements file contents support in OSExchangeData and DropTarget
for gtk. Makes html and file contents support in OSExchangeData only
for windows (as that is the only place we need it), and makes dragging
files work.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/232002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26995 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/os_exchange_data.cc')
-rw-r--r-- | app/os_exchange_data.cc | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/app/os_exchange_data.cc b/app/os_exchange_data.cc index 9361466..8f647c2 100644 --- a/app/os_exchange_data.cc +++ b/app/os_exchange_data.cc @@ -32,15 +32,6 @@ void OSExchangeData::SetPickledData(CustomFormat format, const Pickle& data) { provider_->SetPickledData(format, data); } -void OSExchangeData::SetFileContents(const std::wstring& filename, - const std::string& file_contents) { - provider_->SetFileContents(filename, file_contents); -} - -void OSExchangeData::SetHtml(const std::wstring& html, const GURL& base_url) { - provider_->SetHtml(html, base_url); -} - bool OSExchangeData::GetString(std::wstring* data) const { return provider_->GetString(data); } @@ -57,15 +48,6 @@ bool OSExchangeData::GetPickledData(CustomFormat format, Pickle* data) const { return provider_->GetPickledData(format, data); } -bool OSExchangeData::GetFileContents(std::wstring* filename, - std::string* file_contents) const { - return provider_->GetFileContents(filename, file_contents); -} - -bool OSExchangeData::GetHtml(std::wstring* html, GURL* base_url) const { - return provider_->GetHtml(html, base_url); -} - bool OSExchangeData::HasString() const { return provider_->HasString(); } @@ -89,12 +71,14 @@ bool OSExchangeData::HasAllFormats( return false; if ((formats & URL) != 0 && !HasURL()) return false; +#if defined(OS_WIN) if ((formats & FILE_CONTENTS) != 0 && !provider_->HasFileContents()) return false; - if ((formats & FILE_NAME) != 0 && !provider_->HasFile()) - return false; if ((formats & HTML) != 0 && !provider_->HasHtml()) return false; +#endif + if ((formats & FILE_NAME) != 0 && !provider_->HasFile()) + return false; for (std::set<CustomFormat>::const_iterator i = custom_formats.begin(); i != custom_formats.end(); ++i) { if (!HasCustomFormat(*i)) @@ -110,12 +94,14 @@ bool OSExchangeData::HasAnyFormat( return true; if ((formats & URL) != 0 && HasURL()) return true; +#if defined(OS_WIN) if ((formats & FILE_CONTENTS) != 0 && provider_->HasFileContents()) return true; - if ((formats & FILE_NAME) != 0 && provider_->HasFile()) - return true; if ((formats & HTML) != 0 && provider_->HasHtml()) return true; +#endif + if ((formats & FILE_NAME) != 0 && provider_->HasFile()) + return true; for (std::set<CustomFormat>::const_iterator i = custom_formats.begin(); i != custom_formats.end(); ++i) { if (HasCustomFormat(*i)) @@ -123,3 +109,23 @@ bool OSExchangeData::HasAnyFormat( } return false; } + +#if defined(OS_WIN) +void OSExchangeData::SetFileContents(const std::wstring& filename, + const std::string& file_contents) { + provider_->SetFileContents(filename, file_contents); +} + +void OSExchangeData::SetHtml(const std::wstring& html, const GURL& base_url) { + provider_->SetHtml(html, base_url); +} + +bool OSExchangeData::GetFileContents(std::wstring* filename, + std::string* file_contents) const { + return provider_->GetFileContents(filename, file_contents); +} + +bool OSExchangeData::GetHtml(std::wstring* html, GURL* base_url) const { + return provider_->GetHtml(html, base_url); +} +#endif |