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

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

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 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
« no previous file with comments | « ui/views/bubble/tray_bubble_view.cc ('k') | ui/views/cocoa/bridged_native_widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 gfx::Size prefsize = button.GetPreferredSize(); 74 gfx::Size prefsize = button.GetPreferredSize();
75 button.SetBounds(0, 0, prefsize.width(), prefsize.height()); 75 button.SetBounds(0, 0, prefsize.width(), prefsize.height());
76 76
77 gfx::Vector2d press_point; 77 gfx::Vector2d press_point;
78 if (press_pt) 78 if (press_pt)
79 press_point = press_pt->OffsetFromOrigin(); 79 press_point = press_pt->OffsetFromOrigin();
80 else 80 else
81 press_point = gfx::Vector2d(prefsize.width() / 2, prefsize.height() / 2); 81 press_point = gfx::Vector2d(prefsize.width() / 2, prefsize.height() / 2);
82 82
83 // Render the image. 83 // Render the image.
84 scoped_ptr<gfx::Canvas> canvas( 84 std::unique_ptr<gfx::Canvas> canvas(
85 views::GetCanvasForDragImage(widget, prefsize)); 85 views::GetCanvasForDragImage(widget, prefsize));
86 button.Paint(ui::CanvasPainter(canvas.get(), 1.f).context()); 86 button.Paint(ui::CanvasPainter(canvas.get(), 1.f).context());
87 drag_utils::SetDragImageOnDataObject(*canvas, press_point, data); 87 drag_utils::SetDragImageOnDataObject(*canvas, press_point, data);
88 } 88 }
89 89
90 } // namespace button_drag_utils 90 } // namespace button_drag_utils
OLDNEW
« no previous file with comments | « ui/views/bubble/tray_bubble_view.cc ('k') | ui/views/cocoa/bridged_native_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698