| 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 "app/gfx/canvas.h" | |
| 8 #include "app/gfx/font.h" | |
| 9 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 10 #include "app/os_exchange_data.h" | 8 #include "app/os_exchange_data.h" |
| 11 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 12 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 13 #include "base/logging.h" | 11 #include "base/logging.h" |
| 14 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "gfx/canvas.h" |
| 14 #include "gfx/font.h" |
| 15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 16 #include "grit/app_resources.h" | 16 #include "grit/app_resources.h" |
| 17 #include "views/controls/button/text_button.h" | 17 #include "views/controls/button/text_button.h" |
| 18 | 18 |
| 19 namespace drag_utils { | 19 namespace drag_utils { |
| 20 | 20 |
| 21 // Maximum width of the link drag image in pixels. | 21 // Maximum width of the link drag image in pixels. |
| 22 static const int kLinkDragImageMaxWidth = 200; | 22 static const int kLinkDragImageMaxWidth = 200; |
| 23 static const int kLinkDragImageVPadding = 3; | 23 static const int kLinkDragImageVPadding = 3; |
| 24 | 24 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 0, icon->height() + kLinkDragImageVPadding, | 86 0, icon->height() + kLinkDragImageVPadding, |
| 87 width, font.height(), gfx::Canvas::TEXT_ALIGN_CENTER); | 87 width, font.height(), gfx::Canvas::TEXT_ALIGN_CENTER); |
| 88 #endif | 88 #endif |
| 89 | 89 |
| 90 SetDragImageOnDataObject(canvas, gfx::Size(width, height), | 90 SetDragImageOnDataObject(canvas, gfx::Size(width, height), |
| 91 gfx::Point(width / 2, kLinkDragImageVPadding), | 91 gfx::Point(width / 2, kLinkDragImageVPadding), |
| 92 data_object); | 92 data_object); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace drag_utils | 95 } // namespace drag_utils |
| OLD | NEW |