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_provider_aura.h" | 5 #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "net/base/net_util.h" | 9 #include "net/base/net_util.h" |
10 #include "ui/base/clipboard/clipboard.h" | 10 #include "ui/base/clipboard/clipboard.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 return false; | 155 return false; |
156 *html = html_; | 156 *html = html_; |
157 *base_url = base_url_; | 157 *base_url = base_url_; |
158 return true; | 158 return true; |
159 } | 159 } |
160 | 160 |
161 bool OSExchangeDataProviderAura::HasHtml() const { | 161 bool OSExchangeDataProviderAura::HasHtml() const { |
162 return ((formats_ & OSExchangeData::HTML) != 0); | 162 return ((formats_ & OSExchangeData::HTML) != 0); |
163 } | 163 } |
164 | 164 |
| 165 void OSExchangeDataProviderAura::SetDragImage( |
| 166 const gfx::ImageSkia& image, |
| 167 const gfx::Vector2d& cursor_offset) { |
| 168 drag_image_ = image; |
| 169 drag_image_offset_ = cursor_offset; |
| 170 } |
| 171 |
| 172 const gfx::ImageSkia& OSExchangeDataProviderAura::GetDragImage() const { |
| 173 return drag_image_; |
| 174 } |
| 175 |
| 176 const gfx::Vector2d& OSExchangeDataProviderAura::GetDragImageOffset() const { |
| 177 return drag_image_offset_; |
| 178 } |
| 179 |
165 bool OSExchangeDataProviderAura::GetPlainTextURL(GURL* url) const { | 180 bool OSExchangeDataProviderAura::GetPlainTextURL(GURL* url) const { |
166 if ((formats_ & OSExchangeData::STRING) == 0) | 181 if ((formats_ & OSExchangeData::STRING) == 0) |
167 return false; | 182 return false; |
168 | 183 |
169 GURL test_url(string_); | 184 GURL test_url(string_); |
170 if (!test_url.is_valid()) | 185 if (!test_url.is_valid()) |
171 return false; | 186 return false; |
172 | 187 |
173 if (url) | 188 if (url) |
174 *url = test_url; | 189 *url = test_url; |
(...skipping 12 matching lines...) Expand all Loading... |
187 OSExchangeData::CustomFormat | 202 OSExchangeData::CustomFormat |
188 OSExchangeData::RegisterCustomFormat(const std::string& type) { | 203 OSExchangeData::RegisterCustomFormat(const std::string& type) { |
189 // On Aura you probably want to just use the Clipboard::Get*FormatType APIs | 204 // On Aura you probably want to just use the Clipboard::Get*FormatType APIs |
190 // instead. But we can also dynamically generate new CustomFormat objects | 205 // instead. But we can also dynamically generate new CustomFormat objects |
191 // here too if really necessary. | 206 // here too if really necessary. |
192 return Clipboard::FormatType::Deserialize(type); | 207 return Clipboard::FormatType::Deserialize(type); |
193 } | 208 } |
194 | 209 |
195 | 210 |
196 } // namespace ui | 211 } // namespace ui |
OLD | NEW |