| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_WIN_H_ | 5 #ifndef UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_WIN_H_ |
| 6 #define UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_WIN_H_ | 6 #define UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <objidl.h> | 9 #include <objidl.h> |
| 10 #include <shlobj.h> | 10 #include <shlobj.h> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/scoped_comptr_win.h" | 13 #include "base/win/scoped_comptr.h" |
| 14 #include "ui/base/dragdrop/os_exchange_data.h" | 14 #include "ui/base/dragdrop/os_exchange_data.h" |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 | 17 |
| 18 class DataObjectImpl : public DownloadFileObserver, | 18 class DataObjectImpl : public DownloadFileObserver, |
| 19 public IDataObject, | 19 public IDataObject, |
| 20 public IAsyncOperation { | 20 public IAsyncOperation { |
| 21 public: | 21 public: |
| 22 class Observer { | 22 class Observer { |
| 23 public: | 23 public: |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 delete medium; | 105 delete medium; |
| 106 } | 106 } |
| 107 if (downloader.get()) | 107 if (downloader.get()) |
| 108 downloader->Stop(); | 108 downloader->Stop(); |
| 109 } | 109 } |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 typedef std::vector<StoredDataInfo*> StoredData; | 112 typedef std::vector<StoredDataInfo*> StoredData; |
| 113 StoredData contents_; | 113 StoredData contents_; |
| 114 | 114 |
| 115 ScopedComPtr<IDataObject> source_object_; | 115 base::win::ScopedComPtr<IDataObject> source_object_; |
| 116 | 116 |
| 117 bool is_aborting_; | 117 bool is_aborting_; |
| 118 bool in_async_mode_; | 118 bool in_async_mode_; |
| 119 bool async_operation_started_; | 119 bool async_operation_started_; |
| 120 Observer* observer_; | 120 Observer* observer_; |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 class OSExchangeDataProviderWin : public OSExchangeData::Provider { | 123 class OSExchangeDataProviderWin : public OSExchangeData::Provider { |
| 124 public: | 124 public: |
| 125 // Returns true if source has plain text that is a valid url. | 125 // Returns true if source has plain text that is a valid url. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 virtual bool HasURL() const; | 163 virtual bool HasURL() const; |
| 164 virtual bool HasFile() const; | 164 virtual bool HasFile() const; |
| 165 virtual bool HasFileContents() const; | 165 virtual bool HasFileContents() const; |
| 166 virtual bool HasHtml() const; | 166 virtual bool HasHtml() const; |
| 167 virtual bool HasCustomFormat(OSExchangeData::CustomFormat format) const; | 167 virtual bool HasCustomFormat(OSExchangeData::CustomFormat format) const; |
| 168 virtual void SetDownloadFileInfo( | 168 virtual void SetDownloadFileInfo( |
| 169 const OSExchangeData::DownloadFileInfo& download_info); | 169 const OSExchangeData::DownloadFileInfo& download_info); |
| 170 | 170 |
| 171 private: | 171 private: |
| 172 scoped_refptr<DataObjectImpl> data_; | 172 scoped_refptr<DataObjectImpl> data_; |
| 173 ScopedComPtr<IDataObject> source_object_; | 173 base::win::ScopedComPtr<IDataObject> source_object_; |
| 174 | 174 |
| 175 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderWin); | 175 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderWin); |
| 176 }; | 176 }; |
| 177 | 177 |
| 178 } // namespace ui | 178 } // namespace ui |
| 179 | 179 |
| 180 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_WIN_H_ | 180 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_WIN_H_ |
| OLD | NEW |