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.chrome.browser.photo_picker; | 5 package org.chromium.chrome.browser.photo_picker; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.os.Bundle; | 8 import android.os.Bundle; |
9 import android.support.v7.app.AlertDialog; | 9 import android.support.v7.app.AlertDialog; |
10 import android.view.ViewGroup.LayoutParams; | 10 import android.view.ViewGroup.LayoutParams; |
11 import android.view.WindowManager; | 11 import android.view.WindowManager; |
12 | 12 |
| 13 import org.chromium.base.VisibleForTesting; |
13 import org.chromium.chrome.R; | 14 import org.chromium.chrome.R; |
14 import org.chromium.ui.PhotoPickerListener; | 15 import org.chromium.ui.PhotoPickerListener; |
15 | 16 |
16 /** | 17 /** |
17 * UI for the photo chooser that shows on the Android platform as a result of | 18 * UI for the photo chooser that shows on the Android platform as a result of |
18 * <input type=file accept=image > form element. | 19 * <input type=file accept=image > form element. |
19 */ | 20 */ |
20 public class PhotoPickerDialog extends AlertDialog { | 21 public class PhotoPickerDialog extends AlertDialog { |
21 // The category we're showing photos for. | 22 // The category we're showing photos for. |
22 private PickerCategoryView mCategoryView; | 23 private PickerCategoryView mCategoryView; |
(...skipping 22 matching lines...) Expand all Loading... |
45 getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARE
NT); | 46 getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARE
NT); |
46 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, | 47 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, |
47 WindowManager.LayoutParams.FLAG_FULLSCREEN); | 48 WindowManager.LayoutParams.FLAG_FULLSCREEN); |
48 } | 49 } |
49 | 50 |
50 @Override | 51 @Override |
51 public void dismiss() { | 52 public void dismiss() { |
52 super.dismiss(); | 53 super.dismiss(); |
53 mCategoryView.onDialogDismissed(); | 54 mCategoryView.onDialogDismissed(); |
54 } | 55 } |
| 56 |
| 57 @VisibleForTesting |
| 58 public PickerCategoryView getCategoryViewForTesting() { |
| 59 return mCategoryView; |
| 60 } |
55 } | 61 } |
OLD | NEW |