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

Side by Side Diff: printing/backend/print_backend_win.cc

Issue 10067034: RefCounted types should not have public destructors, printing/ and ui/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implementation ordering Created 8 years, 7 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 | Annotate | Revision Log
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 "printing/backend/print_backend.h" 5 #include "printing/backend/print_backend.h"
6 6
7 #include <objidl.h> 7 #include <objidl.h>
8 #include <winspool.h> 8 #include <winspool.h>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 20 matching lines...) Expand all
31 return hr; 31 return hr;
32 } 32 }
33 33
34 } // namespace 34 } // namespace
35 35
36 namespace printing { 36 namespace printing {
37 37
38 class PrintBackendWin : public PrintBackend { 38 class PrintBackendWin : public PrintBackend {
39 public: 39 public:
40 PrintBackendWin() {} 40 PrintBackendWin() {}
41
42 // PrintBackend implementation.
43 virtual bool EnumeratePrinters(PrinterList* printer_list) OVERRIDE;
44 virtual std::string GetDefaultPrinterName() OVERRIDE;
45 virtual bool GetPrinterCapsAndDefaults(
46 const std::string& printer_name,
47 PrinterCapsAndDefaults* printer_info) OVERRIDE;
48 virtual std::string GetPrinterDriverInfo(
49 const std::string& printer_name) OVERRIDE;
50 virtual bool IsValidPrinter(const std::string& printer_name) OVERRIDE;
51
52 protected:
41 virtual ~PrintBackendWin() {} 53 virtual ~PrintBackendWin() {}
42
43 virtual bool EnumeratePrinters(PrinterList* printer_list);
44
45 virtual std::string GetDefaultPrinterName();
46
47 virtual bool GetPrinterCapsAndDefaults(const std::string& printer_name,
48 PrinterCapsAndDefaults* printer_info);
49
50 virtual std::string GetPrinterDriverInfo(const std::string& printer_name);
51
52 virtual bool IsValidPrinter(const std::string& printer_name);
53 }; 54 };
54 55
55 bool PrintBackendWin::EnumeratePrinters(PrinterList* printer_list) { 56 bool PrintBackendWin::EnumeratePrinters(PrinterList* printer_list) {
56 DCHECK(printer_list); 57 DCHECK(printer_list);
57 DWORD bytes_needed = 0; 58 DWORD bytes_needed = 0;
58 DWORD count_returned = 0; 59 DWORD count_returned = 0;
59 const DWORD kLevel = 4; 60 const DWORD kLevel = 4;
60 BOOL ret = EnumPrinters(PRINTER_ENUM_LOCAL|PRINTER_ENUM_CONNECTIONS, NULL, 61 BOOL ret = EnumPrinters(PRINTER_ENUM_LOCAL|PRINTER_ENUM_CONNECTIONS, NULL,
61 kLevel, NULL, 0, &bytes_needed, &count_returned); 62 kLevel, NULL, 0, &bytes_needed, &count_returned);
62 if (!bytes_needed) 63 if (!bytes_needed)
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 printer_handle.Receive(), NULL); 186 printer_handle.Receive(), NULL);
186 return printer_handle.IsValid(); 187 return printer_handle.IsValid();
187 } 188 }
188 189
189 scoped_refptr<PrintBackend> PrintBackend::CreateInstance( 190 scoped_refptr<PrintBackend> PrintBackend::CreateInstance(
190 const base::DictionaryValue* print_backend_settings) { 191 const base::DictionaryValue* print_backend_settings) {
191 return new PrintBackendWin; 192 return new PrintBackendWin;
192 } 193 }
193 194
194 } // namespace printing 195 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698