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

Side by Side Diff: printing/backend/win_helper.h

Issue 1863223002: Convert //printing to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « printing/backend/printing_info_win.cc ('k') | printing/backend/win_helper.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 PRINTING_BACKEND_WIN_HELPER_H_ 5 #ifndef PRINTING_BACKEND_WIN_HELPER_H_
6 #define PRINTING_BACKEND_WIN_HELPER_H_ 6 #define PRINTING_BACKEND_WIN_HELPER_H_
7 7
8 #include <objidl.h> 8 #include <objidl.h>
9 #include <prntvpt.h> 9 #include <prntvpt.h>
10 #include <winspool.h> 10 #include <winspool.h>
11 #include <xpsprint.h> 11 #include <xpsprint.h>
12 12
13 #include <memory>
13 #include <string> 14 #include <string>
14 15
15 #include "base/macros.h" 16 #include "base/macros.h"
16 #include "base/memory/free_deleter.h" 17 #include "base/memory/free_deleter.h"
17 #include "base/memory/scoped_ptr.h"
18 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
19 #include "base/win/scoped_handle.h" 19 #include "base/win/scoped_handle.h"
20 #include "printing/printing_export.h" 20 #include "printing/printing_export.h"
21 21
22 // These are helper functions for dealing with Windows Printing. 22 // These are helper functions for dealing with Windows Printing.
23 namespace printing { 23 namespace printing {
24 24
25 struct PRINTING_EXPORT PrinterBasicInfo; 25 struct PRINTING_EXPORT PrinterBasicInfo;
26 26
27 class PrinterHandleTraits { 27 class PrinterHandleTraits {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 private: 165 private:
166 XPSPrintModule() { } 166 XPSPrintModule() { }
167 static bool InitImpl(); 167 static bool InitImpl();
168 }; 168 };
169 169
170 PRINTING_EXPORT bool InitBasicPrinterInfo(HANDLE printer, 170 PRINTING_EXPORT bool InitBasicPrinterInfo(HANDLE printer,
171 PrinterBasicInfo* printer_info); 171 PrinterBasicInfo* printer_info);
172 172
173 PRINTING_EXPORT std::string GetDriverInfo(HANDLE printer); 173 PRINTING_EXPORT std::string GetDriverInfo(HANDLE printer);
174 174
175 PRINTING_EXPORT scoped_ptr<DEVMODE, base::FreeDeleter> XpsTicketToDevMode( 175 PRINTING_EXPORT std::unique_ptr<DEVMODE, base::FreeDeleter> XpsTicketToDevMode(
176 const base::string16& printer_name, 176 const base::string16& printer_name,
177 const std::string& print_ticket); 177 const std::string& print_ticket);
178 178
179 // Creates default DEVMODE and sets color option. Some devices need special 179 // Creates default DEVMODE and sets color option. Some devices need special
180 // workaround for color. 180 // workaround for color.
181 PRINTING_EXPORT scoped_ptr<DEVMODE, base::FreeDeleter> CreateDevModeWithColor( 181 PRINTING_EXPORT std::unique_ptr<DEVMODE, base::FreeDeleter>
182 HANDLE printer, 182 CreateDevModeWithColor(HANDLE printer,
183 const base::string16& printer_name, 183 const base::string16& printer_name,
184 bool color); 184 bool color);
185 185
186 // Creates new DEVMODE. If |in| is not NULL copy settings from there. 186 // Creates new DEVMODE. If |in| is not NULL copy settings from there.
187 PRINTING_EXPORT scoped_ptr<DEVMODE, base::FreeDeleter> CreateDevMode( 187 PRINTING_EXPORT std::unique_ptr<DEVMODE, base::FreeDeleter> CreateDevMode(
188 HANDLE printer, 188 HANDLE printer,
189 DEVMODE* in); 189 DEVMODE* in);
190 190
191 // Prompts for new DEVMODE. If |in| is not NULL copy settings from there. 191 // Prompts for new DEVMODE. If |in| is not NULL copy settings from there.
192 PRINTING_EXPORT scoped_ptr<DEVMODE, base::FreeDeleter> PromptDevMode( 192 PRINTING_EXPORT std::unique_ptr<DEVMODE, base::FreeDeleter> PromptDevMode(
193 HANDLE printer, 193 HANDLE printer,
194 const base::string16& printer_name, 194 const base::string16& printer_name,
195 DEVMODE* in, 195 DEVMODE* in,
196 HWND window, 196 HWND window,
197 bool* canceled); 197 bool* canceled);
198 198
199 } // namespace printing 199 } // namespace printing
200 200
201 #endif // PRINTING_BACKEND_WIN_HELPER_H_ 201 #endif // PRINTING_BACKEND_WIN_HELPER_H_
OLDNEW
« no previous file with comments | « printing/backend/printing_info_win.cc ('k') | printing/backend/win_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698