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

Unified Diff: printing/android/java/src/org/chromium/printing/PrintManagerDelegate.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/PrintManagerDelegate.java
diff --git a/printing/android/java/src/org/chromium/printing/PrintManagerDelegate.java b/printing/android/java/src/org/chromium/printing/PrintManagerDelegate.java
new file mode 100644
index 0000000000000000000000000000000000000000..6e2cb67e9af2535db49649130494e7772440db0a
--- /dev/null
+++ b/printing/android/java/src/org/chromium/printing/PrintManagerDelegate.java
@@ -0,0 +1,23 @@
+// 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;
+
+/**
+ * Defines an interface for the Android system printing service, for easier testing.
+ * We can't simply extend from {@link android.print.PrintManager}, since it's a final class.
+ */
+public interface PrintManagerDelegate {
+
+ /**
+ * Same as {@link android.print.PrintManager#print}, except this doesn't return a
+ * {@link android.print.PrintJob} since the clients don't need it.
+ */
+ void print(String printJobName,
+ PrintDocumentAdapter documentAdapter,
+ PrintAttributes attributes);
+}
« no previous file with comments | « chrome/browser/android/tab_android.cc ('k') | printing/android/java/src/org/chromium/printing/PrintManagerDelegateImpl.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698