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

Side by Side Diff: printing/printing_context.cc

Issue 484373002: Fixed return value in PrintingContext::OnError(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | 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 26 matching lines...) Expand all
37 ReleaseContext(); 37 ReleaseContext();
38 38
39 settings_.Clear(); 39 settings_.Clear();
40 40
41 in_print_job_ = false; 41 in_print_job_ = false;
42 dialog_box_dismissed_ = false; 42 dialog_box_dismissed_ = false;
43 abort_printing_ = false; 43 abort_printing_ = false;
44 } 44 }
45 45
46 PrintingContext::Result PrintingContext::OnError() { 46 PrintingContext::Result PrintingContext::OnError() {
47 Result result = abort_printing_ ? CANCEL : FAILED;
47 ResetSettings(); 48 ResetSettings();
48 return abort_printing_ ? CANCEL : FAILED; 49 return result;
49 } 50 }
50 51
51 PrintingContext::Result PrintingContext::UsePdfSettings() { 52 PrintingContext::Result PrintingContext::UsePdfSettings() {
52 scoped_ptr<base::DictionaryValue> pdf_settings(new base::DictionaryValue); 53 scoped_ptr<base::DictionaryValue> pdf_settings(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);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 kCloudPrintMarginInch * settings_.device_units_per_inch()); 110 kCloudPrintMarginInch * settings_.device_units_per_inch());
110 } 111 }
111 settings_.SetPrinterPrintableArea(paper_size, paper_rect, true); 112 settings_.SetPrinterPrintableArea(paper_size, paper_rect, true);
112 return OK; 113 return OK;
113 } 114 }
114 115
115 return UpdatePrinterSettings(open_in_external_preview); 116 return UpdatePrinterSettings(open_in_external_preview);
116 } 117 }
117 118
118 } // namespace printing 119 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698