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

Side by Side Diff: printing/printing_context.cc

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added SK_API to vector platform device skia Created 9 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
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/values.h" 7 #include "base/values.h"
8 #include "printing/print_settings_initializer.h"
8 9
9 namespace printing { 10 namespace printing {
10 11
11 PrintingContext::PrintingContext(const std::string& app_locale) 12 PrintingContext::PrintingContext(const std::string& app_locale)
12 : dialog_box_dismissed_(false), 13 : dialog_box_dismissed_(false),
13 in_print_job_(false), 14 in_print_job_(false),
14 abort_printing_(false), 15 abort_printing_(false),
15 app_locale_(app_locale) { 16 app_locale_(app_locale) {
16 } 17 }
17 18
18 PrintingContext::~PrintingContext() { 19 PrintingContext::~PrintingContext() {
19 } 20 }
20 21
21 void PrintingContext::ResetSettings() { 22 void PrintingContext::ResetSettings() {
22 ReleaseContext(); 23 ReleaseContext();
23 24
24 settings_.Clear(); 25 settings_.Clear();
25 26
26 in_print_job_ = false; 27 in_print_job_ = false;
27 dialog_box_dismissed_ = false; 28 dialog_box_dismissed_ = false;
28 abort_printing_ = false; 29 abort_printing_ = false;
29 } 30 }
30 31
31 PrintingContext::Result PrintingContext::OnError() { 32 PrintingContext::Result PrintingContext::OnError() {
32 ResetSettings(); 33 ResetSettings();
33 return abort_printing_ ? CANCEL : FAILED; 34 return abort_printing_ ? CANCEL : FAILED;
34 } 35 }
35 36
37 PrintingContext::Result PrintingContext::UpdatePrintSettings(
38 const base::DictionaryValue& job_settings,
39 const PageRanges& ranges) {
40 PrintingContext::Result result = UpdatePrinterSettings(job_settings, ranges);
41 printing::PrintSettingsInitializer::InitHeaderFooterStrings(job_settings,
42 &settings_);
43 return result;
44 }
45
36 } // namespace printing 46 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698