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

Unified Diff: ui/android/java/src/org/chromium/ui/PhotoPickerListener.java

Issue 2737393002: Implement the new Photo picker, part one. (Closed)
Patch Set: git cl upload Created 3 years, 9 months 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
« no previous file with comments | « ui/android/BUILD.gn ('k') | ui/android/java/src/org/chromium/ui/UiUtils.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+}
« no previous file with comments | « ui/android/BUILD.gn ('k') | ui/android/java/src/org/chromium/ui/UiUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698