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_win.h" | 5 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 STGMEDIUM* storage = NULL; | 530 STGMEDIUM* storage = NULL; |
531 if (!download.filename.empty()) | 531 if (!download.filename.empty()) |
532 storage = GetStorageForFileName(download.filename); | 532 storage = GetStorageForFileName(download.filename); |
533 | 533 |
534 // Add CF_HDROP. | 534 // Add CF_HDROP. |
535 DataObjectImpl::StoredDataInfo* info = new DataObjectImpl::StoredDataInfo( | 535 DataObjectImpl::StoredDataInfo* info = new DataObjectImpl::StoredDataInfo( |
536 Clipboard::GetCFHDropFormatType().ToFormatEtc(), storage); | 536 Clipboard::GetCFHDropFormatType().ToFormatEtc(), storage); |
537 info->downloader = download.downloader; | 537 info->downloader = download.downloader; |
538 data_->contents_.push_back(info); | 538 data_->contents_.push_back(info); |
539 } | 539 } |
540 #if defined(USE_AURA) | |
541 | 540 |
542 void OSExchangeDataProviderWin::SetDragImage( | 541 void OSExchangeDataProviderWin::SetDragImage( |
543 const gfx::ImageSkia& image, | 542 const gfx::ImageSkia& image, |
544 const gfx::Vector2d& cursor_offset) { | 543 const gfx::Vector2d& cursor_offset) { |
545 drag_image_ = image; | 544 drag_image_ = image; |
546 drag_image_offset_ = cursor_offset; | 545 drag_image_offset_ = cursor_offset; |
547 } | 546 } |
548 | 547 |
549 const gfx::ImageSkia& OSExchangeDataProviderWin::GetDragImage() const { | 548 const gfx::ImageSkia& OSExchangeDataProviderWin::GetDragImage() const { |
550 return drag_image_; | 549 return drag_image_; |
551 } | 550 } |
552 | 551 |
553 const gfx::Vector2d& OSExchangeDataProviderWin::GetDragImageOffset() const { | 552 const gfx::Vector2d& OSExchangeDataProviderWin::GetDragImageOffset() const { |
554 return drag_image_offset_; | 553 return drag_image_offset_; |
555 } | 554 } |
556 | 555 |
557 #endif | |
558 | |
559 /////////////////////////////////////////////////////////////////////////////// | 556 /////////////////////////////////////////////////////////////////////////////// |
560 // DataObjectImpl, IDataObject implementation: | 557 // DataObjectImpl, IDataObject implementation: |
561 | 558 |
562 // The following function, DuplicateMedium, is derived from WCDataObject.cpp | 559 // The following function, DuplicateMedium, is derived from WCDataObject.cpp |
563 // in the WebKit source code. This is the license information for the file: | 560 // in the WebKit source code. This is the license information for the file: |
564 /* | 561 /* |
565 * Copyright (C) 2007 Apple Inc. All rights reserved. | 562 * Copyright (C) 2007 Apple Inc. All rights reserved. |
566 * | 563 * |
567 * Redistribution and use in source and binary forms, with or without | 564 * Redistribution and use in source and binary forms, with or without |
568 * modification, are permitted provided that the following conditions | 565 * modification, are permitted provided that the following conditions |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 | 1052 |
1056 /////////////////////////////////////////////////////////////////////////////// | 1053 /////////////////////////////////////////////////////////////////////////////// |
1057 // OSExchangeData, public: | 1054 // OSExchangeData, public: |
1058 | 1055 |
1059 // static | 1056 // static |
1060 OSExchangeData::Provider* OSExchangeData::CreateProvider() { | 1057 OSExchangeData::Provider* OSExchangeData::CreateProvider() { |
1061 return new OSExchangeDataProviderWin(); | 1058 return new OSExchangeDataProviderWin(); |
1062 } | 1059 } |
1063 | 1060 |
1064 } // namespace ui | 1061 } // namespace ui |
OLD | NEW |