Index: ui/android/java/src/org/chromium/ui/PhotoPickerListener.java |
diff --git a/ui/android/java/src/org/chromium/ui/PhotoPickerListener.java b/ui/android/java/src/org/chromium/ui/PhotoPickerListener.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8a8a1d9b125c32c70649c7fd70d5a0c1710aad26 |
--- /dev/null |
+++ b/ui/android/java/src/org/chromium/ui/PhotoPickerListener.java |
@@ -0,0 +1,45 @@ |
+// Copyright 2017 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.ui; |
+ |
+import android.support.annotation.Nullable; |
+ |
+import java.util.Map; |
+ |
+/** |
+ * The callback used to indicate what action the user took in the picker. |
+ */ |
+public interface PhotoPickerListener { |
+ /** |
+ * The action the user took in the picker. |
+ */ |
+ enum Action { |
+ PHOTOS_SELECTED, |
+ LAUNCH_CAMERA, |
+ LAUNCH_GALLERY, |
+ } |
+ |
+ /** |
+ * The types of requests supported. |
+ */ |
+ static final int TAKE_PHOTO_REQUEST = 1; |
+ static final int SHOW_GALLERY = 2; |
+ |
+ /** |
+ * Called when the user has selected an action. For possible actions see above. |
+ * |
+ * @param photos The photos that were selected. |
+ */ |
+ void onPickerUserAction(Action action, String[] photos); |
+ |
+ /** |
+ * Used during testing to provide pre-canned data to the dialog. |
+ * |
+ * @return The test files to use (Map<String, Long>, mapping file paths to creation times) or |
+ * null when run outside of a test. |
+ */ |
+ @Nullable |
+ Map<String, Long> getFilesForTesting(); |
+} |