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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "net/base/filename_util.h" | 10 #include "net/base/filename_util.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 return ((formats_ & OSExchangeData::HTML) != 0); | 176 return ((formats_ & OSExchangeData::HTML) != 0); |
177 } | 177 } |
178 | 178 |
179 void OSExchangeDataProviderAura::SetDragImage( | 179 void OSExchangeDataProviderAura::SetDragImage( |
180 const gfx::ImageSkia& image, | 180 const gfx::ImageSkia& image, |
181 const gfx::Vector2d& cursor_offset) { | 181 const gfx::Vector2d& cursor_offset) { |
182 drag_image_ = image; | 182 drag_image_ = image; |
183 drag_image_offset_ = cursor_offset; | 183 drag_image_offset_ = cursor_offset; |
184 } | 184 } |
185 | 185 |
186 const gfx::ImageSkia& OSExchangeDataProviderAura::GetDragImage() const { | 186 gfx::ImageSkia OSExchangeDataProviderAura::GetDragImage() const { |
187 return drag_image_; | 187 return drag_image_; |
188 } | 188 } |
189 | 189 |
190 const gfx::Vector2d& | 190 gfx::Vector2d OSExchangeDataProviderAura::GetDragImageOffset() const { |
191 OSExchangeDataProviderAura::GetDragImageOffset() const { | |
192 return drag_image_offset_; | 191 return drag_image_offset_; |
193 } | 192 } |
194 | 193 |
195 bool OSExchangeDataProviderAura::GetFileURL(GURL* url) const { | 194 bool OSExchangeDataProviderAura::GetFileURL(GURL* url) const { |
196 base::FilePath file_path; | 195 base::FilePath file_path; |
197 if (!GetFilename(&file_path)) | 196 if (!GetFilename(&file_path)) |
198 return false; | 197 return false; |
199 | 198 |
200 GURL test_url = net::FilePathToFileURL(file_path); | 199 GURL test_url = net::FilePathToFileURL(file_path); |
201 if (!test_url.is_valid()) | 200 if (!test_url.is_valid()) |
(...skipping 11 matching lines...) Expand all Loading... |
213 GURL test_url(string_); | 212 GURL test_url(string_); |
214 if (!test_url.is_valid()) | 213 if (!test_url.is_valid()) |
215 return false; | 214 return false; |
216 | 215 |
217 if (url) | 216 if (url) |
218 *url = test_url; | 217 *url = test_url; |
219 return true; | 218 return true; |
220 } | 219 } |
221 | 220 |
222 } // namespace ui | 221 } // namespace ui |
OLD | NEW |