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

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

Issue 168003002: Use DocumentProperties to get default DEVMODE instead of PRINTER_INFO_*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
« no previous file with comments | « printing/backend/printing_info_win.h ('k') | printing/printing_context_win.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 #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
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
OLDNEW
« no previous file with comments | « printing/backend/printing_info_win.h ('k') | printing/printing_context_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698