| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_DRAG_UTILS_H__ | |
| 6 #define CHROME_BROWSER_DRAG_UTILS_H__ | |
| 7 | |
| 8 #include <objidl.h> | |
| 9 #include <string> | |
| 10 | |
| 11 class ChromeCanvas; | |
| 12 class GURL; | |
| 13 class OSExchangeData; | |
| 14 class SkBitmap; | |
| 15 | |
| 16 namespace drag_utils { | |
| 17 | |
| 18 // Sets url and title on data as well as setting a suitable image for dragging. | |
| 19 // The image looks like that of the bookmark buttons. | |
| 20 void SetURLAndDragImage(const GURL& url, | |
| 21 const std::wstring& title, | |
| 22 const SkBitmap& icon, | |
| 23 OSExchangeData* data); | |
| 24 | |
| 25 // Creates a dragging image to be displayed when the user drags a file from | |
| 26 // Chrome (via the download manager, for example). The drag image is set into | |
| 27 // the supplied data_object. 'file_name' can be a full path, but the directory | |
| 28 // portion will be truncated in the drag image. | |
| 29 void CreateDragImageForFile(const std::wstring& file_name, | |
| 30 SkBitmap* icon, | |
| 31 IDataObject* data_object); | |
| 32 | |
| 33 // Sets the drag image on data_object from the supplied canvas. width/height | |
| 34 // are the size of the image to use, and the offsets give the location of | |
| 35 // the hotspot for the drag image. | |
| 36 void SetDragImageOnDataObject(const ChromeCanvas& canvas, | |
| 37 int width, | |
| 38 int height, | |
| 39 int cursor_x_offset, | |
| 40 int cursor_y_offset, | |
| 41 IDataObject* data_object); | |
| 42 | |
| 43 } // namespace drag_utils | |
| 44 | |
| 45 #endif // #ifndef CHROME_BROWSER_DRAG_UTILS_H__ | |
| OLD | NEW |