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/win/scoped_comptr.h" | 13 #include "base/win/scoped_comptr.h" |
14 #include "ui/ui_api.h" | |
15 #include "ui/base/dragdrop/os_exchange_data.h" | 14 #include "ui/base/dragdrop/os_exchange_data.h" |
| 15 #include "ui/base/ui_export.h" |
16 | 16 |
17 namespace ui { | 17 namespace ui { |
18 | 18 |
19 class DataObjectImpl : public DownloadFileObserver, | 19 class DataObjectImpl : public DownloadFileObserver, |
20 public IDataObject, | 20 public IDataObject, |
21 public IAsyncOperation { | 21 public IAsyncOperation { |
22 public: | 22 public: |
23 class Observer { | 23 class Observer { |
24 public: | 24 public: |
25 virtual void OnWaitForData() = 0; | 25 virtual void OnWaitForData() = 0; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 StoredData contents_; | 120 StoredData contents_; |
121 | 121 |
122 base::win::ScopedComPtr<IDataObject> source_object_; | 122 base::win::ScopedComPtr<IDataObject> source_object_; |
123 | 123 |
124 bool is_aborting_; | 124 bool is_aborting_; |
125 bool in_async_mode_; | 125 bool in_async_mode_; |
126 bool async_operation_started_; | 126 bool async_operation_started_; |
127 Observer* observer_; | 127 Observer* observer_; |
128 }; | 128 }; |
129 | 129 |
130 class UI_API OSExchangeDataProviderWin : public OSExchangeData::Provider { | 130 class UI_EXPORT OSExchangeDataProviderWin : public OSExchangeData::Provider { |
131 public: | 131 public: |
132 // Returns true if source has plain text that is a valid url. | 132 // Returns true if source has plain text that is a valid url. |
133 static bool HasPlainTextURL(IDataObject* source); | 133 static bool HasPlainTextURL(IDataObject* source); |
134 | 134 |
135 // Returns true if source has plain text that is a valid URL and sets url to | 135 // Returns true if source has plain text that is a valid URL and sets url to |
136 // that url. | 136 // that url. |
137 static bool GetPlainTextURL(IDataObject* source, GURL* url); | 137 static bool GetPlainTextURL(IDataObject* source, GURL* url); |
138 | 138 |
139 static DataObjectImpl* GetDataObjectImpl(const OSExchangeData& data); | 139 static DataObjectImpl* GetDataObjectImpl(const OSExchangeData& data); |
140 static IDataObject* GetIDataObject(const OSExchangeData& data); | 140 static IDataObject* GetIDataObject(const OSExchangeData& data); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 private: | 178 private: |
179 scoped_refptr<DataObjectImpl> data_; | 179 scoped_refptr<DataObjectImpl> data_; |
180 base::win::ScopedComPtr<IDataObject> source_object_; | 180 base::win::ScopedComPtr<IDataObject> source_object_; |
181 | 181 |
182 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderWin); | 182 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderWin); |
183 }; | 183 }; |
184 | 184 |
185 } // namespace ui | 185 } // namespace ui |
186 | 186 |
187 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_WIN_H_ | 187 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_WIN_H_ |
OLD | NEW |