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

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

Issue 2737393002: Implement the new Photo picker, part one. (Closed)
Patch Set: Address feedback 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
Index: ui/android/java/src/org/chromium/ui/OnPhotoPickerListener.java
diff --git a/ui/android/java/src/org/chromium/ui/OnPhotoPickerListener.java b/ui/android/java/src/org/chromium/ui/OnPhotoPickerListener.java
new file mode 100644
index 0000000000000000000000000000000000000000..d0530e158ae1bee89a3e0204451f1548592c4c9c
--- /dev/null
+++ b/ui/android/java/src/org/chromium/ui/OnPhotoPickerListener.java
@@ -0,0 +1,46 @@
+// 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 OnPhotoPickerListener {
Theresa 2017/03/15 15:56:32 nit: I like "PhotoPickerListener" better than "OnP
Finnur 2017/03/16 11:38:04 Done.
+ /**
+ * 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.
Theresa 2017/03/15 15:56:32 nit: this should fit on the line above.
Finnur 2017/03/16 11:38:04 Done.
+ *
+ * @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();
+}

Powered by Google App Engine
This is Rietveld 408576698