| OLD | NEW |
| 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; | 7 import android.support.annotation.Nullable; |
| 8 | 8 |
| 9 import java.util.Map; | 9 import java.util.Map; |
| 10 | 10 |
| 11 /** | 11 /** |
| 12 * The callback used to indicate what action the user took in the picker. | 12 * The callback used to indicate what action the user took in the picker. |
| 13 */ | 13 */ |
| 14 public interface PhotoPickerListener { | 14 public interface PhotoPickerListener { |
| 15 /** | 15 /** |
| 16 * The action the user took in the picker. | 16 * The action the user took in the picker. |
| 17 */ | 17 */ |
| 18 enum Action { | 18 enum Action { |
| 19 CANCEL, |
| 19 PHOTOS_SELECTED, | 20 PHOTOS_SELECTED, |
| 20 LAUNCH_CAMERA, | 21 LAUNCH_CAMERA, |
| 21 LAUNCH_GALLERY, | 22 LAUNCH_GALLERY, |
| 22 } | 23 } |
| 23 | 24 |
| 24 /** | 25 /** |
| 25 * The types of requests supported. | 26 * The types of requests supported. |
| 26 */ | 27 */ |
| 27 static final int TAKE_PHOTO_REQUEST = 1; | 28 static final int TAKE_PHOTO_REQUEST = 1; |
| 28 static final int SHOW_GALLERY = 2; | 29 static final int SHOW_GALLERY = 2; |
| 29 | 30 |
| 30 /** | 31 /** |
| 31 * Called when the user has selected an action. For possible actions see abo
ve. | 32 * Called when the user has selected an action. For possible actions see abo
ve. |
| 32 * | 33 * |
| 33 * @param photos The photos that were selected. | 34 * @param photos The photos that were selected. |
| 34 */ | 35 */ |
| 35 void onPickerUserAction(Action action, String[] photos); | 36 void onPickerUserAction(Action action, String[] photos); |
| 36 | 37 |
| 37 /** | 38 /** |
| 38 * Used during testing to provide pre-canned data to the dialog. | 39 * Used during testing to provide pre-canned data to the dialog. |
| 39 * | 40 * |
| 40 * @return The test files to use (Map<String, Long>, mapping file paths to c
reation times) or | 41 * @return The test files to use (Map<String, Long>, mapping file paths to c
reation times) or |
| 41 * null when run outside of a test. | 42 * null when run outside of a test. |
| 42 */ | 43 */ |
| 43 @Nullable | 44 @Nullable |
| 44 Map<String, Long> getFilesForTesting(); | 45 Map<String, Long> getFilesForTesting(); |
| 45 } | 46 } |
| OLD | NEW |