| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 VIEWS_DRAG_UTILS_H_ | 5 #ifndef VIEWS_DRAG_UTILS_H_ |
| 6 #define VIEWS_DRAG_UTILS_H_ | 6 #define VIEWS_DRAG_UTILS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 | 12 |
| 13 class GURL; |
| 14 class SkBitmap; |
| 15 |
| 13 namespace gfx { | 16 namespace gfx { |
| 14 class Canvas; | 17 class Canvas; |
| 15 class Point; | 18 class Point; |
| 16 class Size; | 19 class Size; |
| 17 } | 20 } |
| 18 class GURL; | 21 |
| 22 namespace ui { |
| 19 class OSExchangeData; | 23 class OSExchangeData; |
| 20 class SkBitmap; | 24 } |
| 25 using ui::OSExchangeData; |
| 21 | 26 |
| 22 namespace drag_utils { | 27 namespace drag_utils { |
| 23 | 28 |
| 24 // Sets url and title on data as well as setting a suitable image for dragging. | 29 // Sets url and title on data as well as setting a suitable image for dragging. |
| 25 // The image looks like that of the bookmark buttons. | 30 // The image looks like that of the bookmark buttons. |
| 26 void SetURLAndDragImage(const GURL& url, | 31 void SetURLAndDragImage(const GURL& url, |
| 27 const std::wstring& title, | 32 const std::wstring& title, |
| 28 const SkBitmap& icon, | 33 const SkBitmap& icon, |
| 29 OSExchangeData* data); | 34 OSExchangeData* data); |
| 30 | 35 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 47 // Sets the drag image on data_object from the supplied bitmap. width/height | 52 // Sets the drag image on data_object from the supplied bitmap. width/height |
| 48 // are the size of the image to use, and the offsets give the location of | 53 // are the size of the image to use, and the offsets give the location of |
| 49 // the hotspot for the drag image. | 54 // the hotspot for the drag image. |
| 50 void SetDragImageOnDataObject(const SkBitmap& bitmap, | 55 void SetDragImageOnDataObject(const SkBitmap& bitmap, |
| 51 const gfx::Size& size, | 56 const gfx::Size& size, |
| 52 const gfx::Point& cursor_offset, | 57 const gfx::Point& cursor_offset, |
| 53 OSExchangeData* data_object); | 58 OSExchangeData* data_object); |
| 54 } // namespace drag_utils | 59 } // namespace drag_utils |
| 55 | 60 |
| 56 #endif // #ifndef VIEWS_DRAG_UTILS_H_ | 61 #endif // #ifndef VIEWS_DRAG_UTILS_H_ |
| OLD | NEW |