OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 package org.chromium.printing; | 5 package org.chromium.printing; |
6 | 6 |
7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
8 import android.os.Build; | 8 import android.os.Build; |
9 import android.os.Bundle; | 9 import android.os.Bundle; |
10 import android.os.CancellationSignal; | 10 import android.os.CancellationSignal; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 /** The object through which native PDF generation process is initiated. */ | 82 /** The object through which native PDF generation process is initiated. */ |
83 private Printable mPrintable; | 83 private Printable mPrintable; |
84 | 84 |
85 /** The object through which the framework will make calls for generating PD
F. */ | 85 /** The object through which the framework will make calls for generating PD
F. */ |
86 private PrintDocumentAdapterWrapper mPrintDocumentAdapterWrapper; | 86 private PrintDocumentAdapterWrapper mPrintDocumentAdapterWrapper; |
87 | 87 |
88 private int mPrintingState = PRINTING_STATE_READY; | 88 private int mPrintingState = PRINTING_STATE_READY; |
89 | 89 |
90 /** Whether layouting parameters have been changed to require a new PDF gene
ration. */ | 90 /** Whether layouting parameters have been changed to require a new PDF gene
ration. */ |
91 private boolean mNeedNewPdf = false; | 91 private boolean mNeedNewPdf; |
92 | 92 |
93 /** Total number of pages to print with initial print dialog settings. */ | 93 /** Total number of pages to print with initial print dialog settings. */ |
94 private int mLastKnownMaxPages = PrintDocumentInfo.PAGE_COUNT_UNKNOWN; | 94 private int mLastKnownMaxPages = PrintDocumentInfo.PAGE_COUNT_UNKNOWN; |
95 | 95 |
96 private boolean mIsBusy = false; | 96 private boolean mIsBusy; |
97 | 97 |
98 private PrintManagerDelegate mPrintManager; | 98 private PrintManagerDelegate mPrintManager; |
99 | 99 |
100 private PrintingControllerImpl(PrintDocumentAdapterWrapper printDocumentAdap
terWrapper, | 100 private PrintingControllerImpl(PrintDocumentAdapterWrapper printDocumentAdap
terWrapper, |
101 String errorText) { | 101 String errorText) { |
102 mErrorMessage = errorText; | 102 mErrorMessage = errorText; |
103 mPrintDocumentAdapterWrapper = printDocumentAdapterWrapper; | 103 mPrintDocumentAdapterWrapper = printDocumentAdapterWrapper; |
104 mPrintDocumentAdapterWrapper.setPdfGenerator(this); | 104 mPrintDocumentAdapterWrapper.setPdfGenerator(this); |
105 } | 105 } |
106 | 106 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 419 |
420 // Convert the list into array. | 420 // Convert the list into array. |
421 int[] ret = new int[pages.size()]; | 421 int[] ret = new int[pages.size()]; |
422 Iterator<Integer> iterator = pages.iterator(); | 422 Iterator<Integer> iterator = pages.iterator(); |
423 for (int i = 0; i < ret.length; i++) { | 423 for (int i = 0; i < ret.length; i++) { |
424 ret[i] = iterator.next().intValue(); | 424 ret[i] = iterator.next().intValue(); |
425 } | 425 } |
426 return ret; | 426 return ret; |
427 } | 427 } |
428 } | 428 } |
OLD | NEW |