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

Side by Side Diff: ui/android/java/src/org/chromium/ui/PhotoPickerListener.java

Issue 2894523004: Photo Picker dialog: Add a test. (Closed)
Patch Set: Address feedback from Ted Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.ui; 5 package org.chromium.ui;
6 6
7 import android.support.annotation.Nullable;
8
9 import java.util.Map;
10
11 /** 7 /**
12 * The callback used to indicate what action the user took in the picker. 8 * The callback used to indicate what action the user took in the picker.
13 */ 9 */
14 public interface PhotoPickerListener { 10 public interface PhotoPickerListener {
15 /** 11 /**
16 * The action the user took in the picker. 12 * The action the user took in the picker.
17 */ 13 */
18 enum Action { 14 enum Action {
19 CANCEL, 15 CANCEL,
20 PHOTOS_SELECTED, 16 PHOTOS_SELECTED,
21 LAUNCH_CAMERA, 17 LAUNCH_CAMERA,
22 LAUNCH_GALLERY, 18 LAUNCH_GALLERY,
23 } 19 }
24 20
25 /** 21 /**
26 * The types of requests supported. 22 * The types of requests supported.
27 */ 23 */
28 static final int TAKE_PHOTO_REQUEST = 1; 24 static final int TAKE_PHOTO_REQUEST = 1;
29 static final int SHOW_GALLERY = 2; 25 static final int SHOW_GALLERY = 2;
30 26
31 /** 27 /**
32 * Called when the user has selected an action. For possible actions see abo ve. 28 * Called when the user has selected an action. For possible actions see abo ve.
33 * 29 *
34 * @param photos The photos that were selected. 30 * @param photos The photos that were selected.
35 */ 31 */
36 void onPickerUserAction(Action action, String[] photos); 32 void onPickerUserAction(Action action, String[] photos);
37
38 /**
39 * Used during testing to provide pre-canned data to the dialog.
40 *
41 * @return The test files to use (Map<String, Long>, mapping file paths to c reation times) or
42 * null when run outside of a test.
43 */
44 @Nullable
45 Map<String, Long> getFilesForTesting();
46 } 33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698