OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/printing_context_win.h" | 5 #include "printing/printing_context_win.h" |
6 | 6 |
7 #include <winspool.h> | 7 #include <winspool.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/i18n/file_util_icu.h" | 10 #include "base/i18n/file_util_icu.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 private: | 116 private: |
117 PrintingContextWin& owner_; | 117 PrintingContextWin& owner_; |
118 HWND owner_hwnd_; | 118 HWND owner_hwnd_; |
119 IPrintDialogServices* services_; | 119 IPrintDialogServices* services_; |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(CallbackHandler); | 121 DISALLOW_COPY_AND_ASSIGN(CallbackHandler); |
122 }; | 122 }; |
123 | 123 |
124 // static | 124 // static |
125 PrintingContext* PrintingContext::Create() { | 125 PrintingContext* PrintingContext::Create(const std::string& app_locale) { |
126 return static_cast<PrintingContext*>(new PrintingContextWin); | 126 return static_cast<PrintingContext*>(new PrintingContextWin(app_locale)); |
127 } | 127 } |
128 | 128 |
129 PrintingContextWin::PrintingContextWin() | 129 PrintingContextWin::PrintingContextWin(const std::string& app_locale) |
130 : PrintingContext(), | 130 : PrintingContext(app_locale), |
131 context_(NULL), | 131 context_(NULL), |
132 dialog_box_(NULL), | 132 dialog_box_(NULL), |
133 print_dialog_func_(&PrintDlgEx) { | 133 print_dialog_func_(&PrintDlgEx) { |
134 } | 134 } |
135 | 135 |
136 PrintingContextWin::~PrintingContextWin() { | 136 PrintingContextWin::~PrintingContextWin() { |
137 ReleaseContext(); | 137 ReleaseContext(); |
138 } | 138 } |
139 | 139 |
140 void PrintingContextWin::AskUserForSettings(HWND view, | 140 void PrintingContextWin::AskUserForSettings(HWND view, |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 if (buf_size) { | 606 if (buf_size) { |
607 buffer->reset(new uint8[buf_size]); | 607 buffer->reset(new uint8[buf_size]); |
608 memset(buffer->get(), 0, buf_size); | 608 memset(buffer->get(), 0, buf_size); |
609 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { | 609 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { |
610 buffer->reset(); | 610 buffer->reset(); |
611 } | 611 } |
612 } | 612 } |
613 } | 613 } |
614 | 614 |
615 } // namespace printing | 615 } // namespace printing |
OLD | NEW |