OLD | NEW |
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/printing_info_win.h" | 5 #include "printing/backend/printing_info_win.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace printing { | 9 namespace printing { |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 if (!::GetPrinter(printer, level, buffer.get(), size, &size)) { | 37 if (!::GetPrinter(printer, level, buffer.get(), size, &size)) { |
38 LOG(WARNING) << "Failed to get PRINTER_INFO_" << level << | 38 LOG(WARNING) << "Failed to get PRINTER_INFO_" << level << |
39 ", error = " << GetLastError(); | 39 ", error = " << GetLastError(); |
40 return NULL; | 40 return NULL; |
41 } | 41 } |
42 return buffer.release(); | 42 return buffer.release(); |
43 } | 43 } |
44 | 44 |
45 } // namespace internal | 45 } // namespace internal |
46 | 46 |
47 UserDefaultDevMode::UserDefaultDevMode() : dev_mode_(NULL) { | |
48 } | |
49 | |
50 bool UserDefaultDevMode::Init(HANDLE printer) { | |
51 if (info_9_.Init(printer)) | |
52 dev_mode_ = info_9_.get()->pDevMode; | |
53 | |
54 if (!dev_mode_ && info_8_.Init(printer)) | |
55 dev_mode_ = info_8_.get()->pDevMode; | |
56 | |
57 if (!dev_mode_ && info_2_.Init(printer)) | |
58 dev_mode_ = info_2_.get()->pDevMode; | |
59 | |
60 return dev_mode_ != NULL; | |
61 } | |
62 | |
63 UserDefaultDevMode::~UserDefaultDevMode() { | |
64 } | |
65 | |
66 } // namespace printing | 47 } // namespace printing |
OLD | NEW |