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

Side by Side Diff: printing/printing_context.cc

Issue 478183005: Added PrintingContext::Delegate to get parent view handle and application locale. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mon Aug 25 23:50:54 PDT 2014 Created 6 years, 3 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/printing_context.h ('k') | printing/printing_context_android.h » ('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"
11 #include "printing/print_job_constants.h" 11 #include "printing/print_job_constants.h"
12 #include "printing/print_settings_conversion.h" 12 #include "printing/print_settings_conversion.h"
13 #include "printing/units.h" 13 #include "printing/units.h"
14 14
15 namespace printing { 15 namespace printing {
16 16
17 namespace { 17 namespace {
18 const float kCloudPrintMarginInch = 0.25; 18 const float kCloudPrintMarginInch = 0.25;
19 } 19 }
20 20
21 PrintingContext::PrintingContext(const std::string& app_locale) 21 PrintingContext::PrintingContext(Delegate* delegate)
22 : dialog_box_dismissed_(false), 22 : delegate_(delegate),
23 dialog_box_dismissed_(false),
23 in_print_job_(false), 24 in_print_job_(false),
24 abort_printing_(false), 25 abort_printing_(false) {
25 app_locale_(app_locale) { 26 CHECK(delegate_);
26 } 27 }
27 28
28 PrintingContext::~PrintingContext() { 29 PrintingContext::~PrintingContext() {
29 } 30 }
30 31
31 void PrintingContext::set_margin_type(MarginType type) { 32 void PrintingContext::set_margin_type(MarginType type) {
32 DCHECK(type != CUSTOM_MARGINS); 33 DCHECK(type != CUSTOM_MARGINS);
33 settings_.set_margin_type(type); 34 settings_.set_margin_type(type);
34 } 35 }
35 36
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 kCloudPrintMarginInch * settings_.device_units_per_inch()); 111 kCloudPrintMarginInch * settings_.device_units_per_inch());
111 } 112 }
112 settings_.SetPrinterPrintableArea(paper_size, paper_rect, true); 113 settings_.SetPrinterPrintableArea(paper_size, paper_rect, true);
113 return OK; 114 return OK;
114 } 115 }
115 116
116 return UpdatePrinterSettings(open_in_external_preview); 117 return UpdatePrinterSettings(open_in_external_preview);
117 } 118 }
118 119
119 } // namespace printing 120 } // namespace printing
OLDNEW
« no previous file with comments | « printing/printing_context.h ('k') | printing/printing_context_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698