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

Side by Side Diff: ui/base/cursor/cursors_aura.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/base/cocoa/three_part_image_unittest.mm ('k') | ui/base/cursor/image_cursors.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/base/cursor/cursors_aura.h" 5 #include "ui/base/cursor/cursors_aura.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 230 }
231 231
232 bool GetCursorBitmap(const Cursor& cursor, 232 bool GetCursorBitmap(const Cursor& cursor,
233 SkBitmap* bitmap, 233 SkBitmap* bitmap,
234 gfx::Point* point) { 234 gfx::Point* point) {
235 DCHECK(bitmap && point); 235 DCHECK(bitmap && point);
236 #if defined(OS_WIN) 236 #if defined(OS_WIN)
237 Cursor cursor_copy = cursor; 237 Cursor cursor_copy = cursor;
238 ui::CursorLoaderWin cursor_loader; 238 ui::CursorLoaderWin cursor_loader;
239 cursor_loader.SetPlatformCursor(&cursor_copy); 239 cursor_loader.SetPlatformCursor(&cursor_copy);
240 const scoped_ptr<SkBitmap> cursor_bitmap(IconUtil::CreateSkBitmapFromHICON( 240 const std::unique_ptr<SkBitmap> cursor_bitmap(
241 cursor_copy.platform())); 241 IconUtil::CreateSkBitmapFromHICON(cursor_copy.platform()));
242 #else 242 #else
243 int resource_id; 243 int resource_id;
244 if (!GetCursorDataFor(ui::CURSOR_SET_NORMAL, 244 if (!GetCursorDataFor(ui::CURSOR_SET_NORMAL,
245 cursor.native_type(), 245 cursor.native_type(),
246 cursor.device_scale_factor(), 246 cursor.device_scale_factor(),
247 &resource_id, 247 &resource_id,
248 point)) { 248 point)) {
249 return false; 249 return false;
250 } 250 }
251 251
252 const SkBitmap* cursor_bitmap = ResourceBundle::GetSharedInstance(). 252 const SkBitmap* cursor_bitmap = ResourceBundle::GetSharedInstance().
253 GetImageSkiaNamed(resource_id)->bitmap(); 253 GetImageSkiaNamed(resource_id)->bitmap();
254 #endif 254 #endif
255 if (!cursor_bitmap) 255 if (!cursor_bitmap)
256 return false; 256 return false;
257 *bitmap = *cursor_bitmap; 257 *bitmap = *cursor_bitmap;
258 return true; 258 return true;
259 } 259 }
260 260
261 } // namespace ui 261 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/cocoa/three_part_image_unittest.mm ('k') | ui/base/cursor/image_cursors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698