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 3 // found in the LICENSE file. 4 5 package org.chromium.printing; 6 7 import android.content.Context; 8 import android.print.PrintAttributes; 9 import android.print.PrintDocumentAdapter; 10 import android.print.PrintManager; 11 12 /** 13 * An implementation of {@link PrintManagerDelegate} using the Android framework print manager. 14 */ 15 public class PrintManagerDelegateImpl implements PrintManagerDelegate { 16 private final PrintManager mPrintManager; 17 PrintManagerDelegateImpl(Context context)18 public PrintManagerDelegateImpl(Context context) { 19 mPrintManager = (PrintManager) context.getSystemService(Context.PRINT_SERVICE); 20 } 21 22 @Override print(String printJobName, PrintDocumentAdapter documentAdapter, PrintAttributes attributes)23 public void print(String printJobName, PrintDocumentAdapter documentAdapter, 24 PrintAttributes attributes) { 25 mPrintManager.print(printJobName, documentAdapter, attributes); 26 } 27 28 } 29