Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: ui/views/button_drag_utils.cc

Issue 2792183002: Delete ash-based code for Windows drag-and-drop graphics. (Closed)
Patch Set: ashdrag: addheaders Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/views/button_drag_utils.h" 5 #include "ui/views/button_drag_utils.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/base/dragdrop/drag_utils.h"
9 #include "ui/base/dragdrop/os_exchange_data.h" 8 #include "ui/base/dragdrop/os_exchange_data.h"
10 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
11 #include "ui/compositor/canvas_painter.h" 10 #include "ui/compositor/canvas_painter.h"
12 #include "ui/gfx/canvas.h" 11 #include "ui/gfx/canvas.h"
13 #include "ui/gfx/geometry/point.h" 12 #include "ui/gfx/geometry/point.h"
14 #include "ui/gfx/geometry/vector2d.h" 13 #include "ui/gfx/geometry/vector2d.h"
15 #include "ui/gfx/image/image.h" 14 #include "ui/gfx/image/image.h"
16 #include "ui/resources/grit/ui_resources.h" 15 #include "ui/resources/grit/ui_resources.h"
17 #include "ui/views/background.h" 16 #include "ui/views/background.h"
18 #include "ui/views/border.h" 17 #include "ui/views/border.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 if (press_pt) 79 if (press_pt)
81 press_point = press_pt->OffsetFromOrigin(); 80 press_point = press_pt->OffsetFromOrigin();
82 else 81 else
83 press_point = gfx::Vector2d(size.width() / 2, size.height() / 2); 82 press_point = gfx::Vector2d(size.width() / 2, size.height() / 2);
84 83
85 SkBitmap bitmap; 84 SkBitmap bitmap;
86 float raster_scale = ScaleFactorForDragFromWidget(&widget); 85 float raster_scale = ScaleFactorForDragFromWidget(&widget);
87 SkColor color = SK_ColorTRANSPARENT; 86 SkColor color = SK_ColorTRANSPARENT;
88 button.Paint(ui::CanvasPainter(&bitmap, size, raster_scale, color).context()); 87 button.Paint(ui::CanvasPainter(&bitmap, size, raster_scale, color).context());
89 gfx::ImageSkia image(gfx::ImageSkiaRep(bitmap, raster_scale)); 88 gfx::ImageSkia image(gfx::ImageSkiaRep(bitmap, raster_scale));
90 drag_utils::SetDragImageOnDataObject(image, press_point, data); 89 data->provider().SetDragImage(image, press_point);
91 } 90 }
92 91
93 } // namespace button_drag_utils 92 } // namespace button_drag_utils
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698