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

Unified Diff: printing/android/java/src/org/chromium/printing/PrintManagerDelegateImpl.java

Issue 63483007: Refactor Android printing code to make it more testable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add license to PrintingControllerFactory Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: printing/android/java/src/org/chromium/printing/PrintManagerDelegateImpl.java
diff --git a/printing/android/java/src/org/chromium/printing/PrintManagerDelegateImpl.java b/printing/android/java/src/org/chromium/printing/PrintManagerDelegateImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..99422a4ab5246bb33bc28f074e0e03386e9e10d1
--- /dev/null
+++ b/printing/android/java/src/org/chromium/printing/PrintManagerDelegateImpl.java
@@ -0,0 +1,27 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.printing;
+
+import android.print.PrintAttributes;
+import android.print.PrintDocumentAdapter;
+import android.print.PrintManager;
+
+/**
+ * An implementation of {@link PrintManagerDelegate} using the Android framework print manager.
+ */
+public class PrintManagerDelegateImpl implements PrintManagerDelegate {
+ private final PrintManager mPrintManager;
+
+ public PrintManagerDelegateImpl(PrintManager printManager) {
+ mPrintManager = printManager;
+ }
+
+ @Override
+ public void print(String printJobName, PrintDocumentAdapter documentAdapter,
+ PrintAttributes attributes) {
+ mPrintManager.print(printJobName, documentAdapter, attributes);
+ }
+
+}

Powered by Google App Engine
This is Rietveld 408576698