| 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 #include "views/drag_utils.h" | 5 #include "views/drag_utils.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "gfx/canvas_skia.h" | |
| 11 #include "gfx/font.h" | |
| 12 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| 13 #include "grit/app_resources.h" | 11 #include "grit/app_resources.h" |
| 14 #include "ui/base/dragdrop/os_exchange_data.h" | 12 #include "ui/base/dragdrop/os_exchange_data.h" |
| 15 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
| 14 #include "ui/gfx/canvas_skia.h" |
| 15 #include "ui/gfx/font.h" |
| 16 #include "views/controls/button/text_button.h" | 16 #include "views/controls/button/text_button.h" |
| 17 | 17 |
| 18 using ui::OSExchangeData; | 18 using ui::OSExchangeData; |
| 19 | 19 |
| 20 namespace drag_utils { | 20 namespace drag_utils { |
| 21 | 21 |
| 22 // Maximum width of the link drag image in pixels. | 22 // Maximum width of the link drag image in pixels. |
| 23 static const int kLinkDragImageMaxWidth = 200; | 23 static const int kLinkDragImageMaxWidth = 200; |
| 24 static const int kLinkDragImageVPadding = 3; | 24 static const int kLinkDragImageVPadding = 3; |
| 25 | 25 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 void SetDragImageOnDataObject(const gfx::Canvas& canvas, | 95 void SetDragImageOnDataObject(const gfx::Canvas& canvas, |
| 96 const gfx::Size& size, | 96 const gfx::Size& size, |
| 97 const gfx::Point& cursor_offset, | 97 const gfx::Point& cursor_offset, |
| 98 OSExchangeData* data_object) { | 98 OSExchangeData* data_object) { |
| 99 SetDragImageOnDataObject( | 99 SetDragImageOnDataObject( |
| 100 canvas.AsCanvasSkia()->ExtractBitmap(), size, cursor_offset, data_object); | 100 canvas.AsCanvasSkia()->ExtractBitmap(), size, cursor_offset, data_object); |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace drag_utils | 103 } // namespace drag_utils |
| OLD | NEW |