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

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

Issue 1053143002: Make View::Paint use ui::PaintRecorder to access PaintContext's canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: paintrecorder: . Created 5 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" 8 #include "ui/base/dragdrop/drag_utils.h"
9 #include "ui/base/dragdrop/os_exchange_data.h" 9 #include "ui/base/dragdrop/os_exchange_data.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
11 #include "ui/compositor/paint_context.h"
11 #include "ui/gfx/canvas.h" 12 #include "ui/gfx/canvas.h"
12 #include "ui/gfx/geometry/point.h" 13 #include "ui/gfx/geometry/point.h"
13 #include "ui/gfx/geometry/vector2d.h" 14 #include "ui/gfx/geometry/vector2d.h"
14 #include "ui/gfx/image/image.h" 15 #include "ui/gfx/image/image.h"
15 #include "ui/resources/grit/ui_resources.h" 16 #include "ui/resources/grit/ui_resources.h"
16 #include "ui/views/controls/button/label_button.h" 17 #include "ui/views/controls/button/label_button.h"
17 #include "ui/views/drag_utils.h" 18 #include "ui/views/drag_utils.h"
18 #include "ui/views/widget/widget.h" 19 #include "ui/views/widget/widget.h"
19 #include "url/gurl.h" 20 #include "url/gurl.h"
20 21
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 69
69 gfx::Vector2d press_point; 70 gfx::Vector2d press_point;
70 if (press_pt) 71 if (press_pt)
71 press_point = press_pt->OffsetFromOrigin(); 72 press_point = press_pt->OffsetFromOrigin();
72 else 73 else
73 press_point = gfx::Vector2d(prefsize.width() / 2, prefsize.height() / 2); 74 press_point = gfx::Vector2d(prefsize.width() / 2, prefsize.height() / 2);
74 75
75 // Render the image. 76 // Render the image.
76 scoped_ptr<gfx::Canvas> canvas( 77 scoped_ptr<gfx::Canvas> canvas(
77 views::GetCanvasForDragImage(widget, prefsize)); 78 views::GetCanvasForDragImage(widget, prefsize));
78 button.Paint(views::View::PaintContext(canvas.get())); 79 button.Paint(ui::PaintContext(canvas.get()));
79 drag_utils::SetDragImageOnDataObject(*canvas, press_point, data); 80 drag_utils::SetDragImageOnDataObject(*canvas, press_point, data);
80 } 81 }
81 82
82 } // namespace button_drag_utils 83 } // namespace button_drag_utils
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698