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

Side by Side Diff: ui/gfx/icon_util.h

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/gfx/harfbuzz_font_skia.cc ('k') | ui/gfx/icon_util.cc » ('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 #ifndef UI_GFX_ICON_UTIL_H_ 5 #ifndef UI_GFX_ICON_UTIL_H_
6 #define UI_GFX_ICON_UTIL_H_ 6 #define UI_GFX_ICON_UTIL_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
11 #include <memory>
11 #include <string> 12 #include <string>
12 #include <vector> 13 #include <vector>
13 14
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/memory/scoped_ptr.h"
16 #include "base/win/scoped_gdi_object.h" 16 #include "base/win/scoped_gdi_object.h"
17 #include "ui/gfx/geometry/point.h" 17 #include "ui/gfx/geometry/point.h"
18 #include "ui/gfx/geometry/size.h" 18 #include "ui/gfx/geometry/size.h"
19 #include "ui/gfx/gfx_export.h" 19 #include "ui/gfx/gfx_export.h"
20 20
21 namespace base { 21 namespace base {
22 class FilePath; 22 class FilePath;
23 } 23 }
24 24
25 namespace gfx { 25 namespace gfx {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // the return value is NULL. 96 // the return value is NULL.
97 // 97 //
98 // The client owns the returned bitmap object and is responsible for deleting 98 // The client owns the returned bitmap object and is responsible for deleting
99 // it when it is no longer needed. 99 // it when it is no longer needed.
100 static SkBitmap* CreateSkBitmapFromHICON(HICON icon, const gfx::Size& s); 100 static SkBitmap* CreateSkBitmapFromHICON(HICON icon, const gfx::Size& s);
101 101
102 // Loads an icon resource as a SkBitmap for the specified |size| from a 102 // Loads an icon resource as a SkBitmap for the specified |size| from a
103 // loaded .dll or .exe |module|. Supports loading smaller icon sizes as well 103 // loaded .dll or .exe |module|. Supports loading smaller icon sizes as well
104 // as the Vista+ 256x256 PNG icon size. If the icon could not be loaded or 104 // as the Vista+ 256x256 PNG icon size. If the icon could not be loaded or
105 // found, returns a NULL scoped_ptr. 105 // found, returns a NULL scoped_ptr.
106 static scoped_ptr<gfx::ImageFamily> CreateImageFamilyFromIconResource( 106 static std::unique_ptr<gfx::ImageFamily> CreateImageFamilyFromIconResource(
107 HMODULE module, 107 HMODULE module,
108 int resource_id); 108 int resource_id);
109 109
110 // Given a valid HICON handle representing an icon, this function converts 110 // Given a valid HICON handle representing an icon, this function converts
111 // the icon into an SkBitmap object containing an ARGB bitmap using the 111 // the icon into an SkBitmap object containing an ARGB bitmap using the
112 // dimensions of HICON. If the function cannot convert the icon to a bitmap 112 // dimensions of HICON. If the function cannot convert the icon to a bitmap
113 // (most probably due to an invalid parameter), the return value is NULL. 113 // (most probably due to an invalid parameter), the return value is NULL.
114 // 114 //
115 // The client owns the returned bitmap object and is responsible for deleting 115 // The client owns the returned bitmap object and is responsible for deleting
116 // it when it is no longer needed. 116 // it when it is no longer needed.
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // A helper function of CreateSkBitmapFromHICON. 265 // A helper function of CreateSkBitmapFromHICON.
266 static SkBitmap CreateSkBitmapFromHICONHelper(HICON icon, 266 static SkBitmap CreateSkBitmapFromHICONHelper(HICON icon,
267 const gfx::Size& s); 267 const gfx::Size& s);
268 268
269 // Prevent clients from instantiating objects of that class by declaring the 269 // Prevent clients from instantiating objects of that class by declaring the
270 // ctor/dtor as private. 270 // ctor/dtor as private.
271 DISALLOW_IMPLICIT_CONSTRUCTORS(IconUtil); 271 DISALLOW_IMPLICIT_CONSTRUCTORS(IconUtil);
272 }; 272 };
273 273
274 #endif // UI_GFX_ICON_UTIL_H_ 274 #endif // UI_GFX_ICON_UTIL_H_
OLDNEW
« no previous file with comments | « ui/gfx/harfbuzz_font_skia.cc ('k') | ui/gfx/icon_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698