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

Side by Side Diff: printing/printing_context.cc

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/printing_context.h ('k') | printing/printing_context_android.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #include "printing/printing_context.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "printing/page_setup.h" 9 #include "printing/page_setup.h"
10 #include "printing/page_size_margins.h" 10 #include "printing/page_size_margins.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 abort_printing_ = false; 42 abort_printing_ = false;
43 } 43 }
44 44
45 PrintingContext::Result PrintingContext::OnError() { 45 PrintingContext::Result PrintingContext::OnError() {
46 Result result = abort_printing_ ? CANCEL : FAILED; 46 Result result = abort_printing_ ? CANCEL : FAILED;
47 ResetSettings(); 47 ResetSettings();
48 return result; 48 return result;
49 } 49 }
50 50
51 PrintingContext::Result PrintingContext::UsePdfSettings() { 51 PrintingContext::Result PrintingContext::UsePdfSettings() {
52 scoped_ptr<base::DictionaryValue> pdf_settings(new base::DictionaryValue); 52 std::unique_ptr<base::DictionaryValue> pdf_settings(
53 new base::DictionaryValue);
53 pdf_settings->SetBoolean(kSettingHeaderFooterEnabled, false); 54 pdf_settings->SetBoolean(kSettingHeaderFooterEnabled, false);
54 pdf_settings->SetBoolean(kSettingShouldPrintBackgrounds, false); 55 pdf_settings->SetBoolean(kSettingShouldPrintBackgrounds, false);
55 pdf_settings->SetBoolean(kSettingShouldPrintSelectionOnly, false); 56 pdf_settings->SetBoolean(kSettingShouldPrintSelectionOnly, false);
56 pdf_settings->SetInteger(kSettingMarginsType, printing::NO_MARGINS); 57 pdf_settings->SetInteger(kSettingMarginsType, printing::NO_MARGINS);
57 pdf_settings->SetBoolean(kSettingCollate, true); 58 pdf_settings->SetBoolean(kSettingCollate, true);
58 pdf_settings->SetInteger(kSettingCopies, 1); 59 pdf_settings->SetInteger(kSettingCopies, 1);
59 pdf_settings->SetInteger(kSettingColor, printing::COLOR); 60 pdf_settings->SetInteger(kSettingColor, printing::COLOR);
60 pdf_settings->SetInteger(kSettingDuplexMode, printing::SIMPLEX); 61 pdf_settings->SetInteger(kSettingDuplexMode, printing::SIMPLEX);
61 pdf_settings->SetBoolean(kSettingLandscape, false); 62 pdf_settings->SetBoolean(kSettingLandscape, false);
62 pdf_settings->SetString(kSettingDeviceName, ""); 63 pdf_settings->SetString(kSettingDeviceName, "");
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 #endif 124 #endif
124 125
125 int page_count = 0; 126 int page_count = 0;
126 job_settings.GetInteger(kSettingPreviewPageCount, &page_count); 127 job_settings.GetInteger(kSettingPreviewPageCount, &page_count);
127 128
128 return UpdatePrinterSettings(open_in_external_preview, show_system_dialog, 129 return UpdatePrinterSettings(open_in_external_preview, show_system_dialog,
129 page_count); 130 page_count);
130 } 131 }
131 132
132 } // namespace printing 133 } // namespace printing
OLDNEW
« no previous file with comments | « printing/printing_context.h ('k') | printing/printing_context_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698