Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PhotoPickerDialog.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PhotoPickerDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PhotoPickerDialog.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..90ec3c5cc4254e0756e8d16617bbb3861f349cfc |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PhotoPickerDialog.java |
| @@ -0,0 +1,48 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
|
Theresa
2017/03/28 20:40:28
s/2016/2017
Finnur
2017/03/31 14:26:49
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.chrome.browser.photo_picker; |
| + |
| +import android.content.Context; |
| +import android.os.Bundle; |
| +import android.support.v7.app.AlertDialog; |
| +import android.view.ViewGroup.LayoutParams; |
| +import android.view.WindowManager; |
| + |
| +import org.chromium.chrome.R; |
| +import org.chromium.ui.PhotoPickerListener; |
| + |
| +/** |
| + * UI for the photo chooser that shows on the Android platform as a result of |
| + * <input type=file accept=image > form element. |
| + */ |
| +public class PhotoPickerDialog extends AlertDialog { |
| + // The category we're showing photos for. |
| + private PickerCategoryView mCategoryView; |
| + |
| + /** |
| + * The PhotoPickerDialog constructor. |
| + * @param context The context to use. |
| + * @param listener The listener object that gets notified when an action is taken. |
| + * @param multiSelection True if the photo picker should allow multiple items to be selected. |
| + */ |
| + public PhotoPickerDialog( |
| + Context context, PhotoPickerListener listener, boolean multiSelection) { |
| + super(context, R.style.FullscreenWhite); |
| + |
| + // Initialize the main content view. |
| + mCategoryView = new PickerCategoryView(context); |
| + mCategoryView.setStartingState(this, listener, multiSelection); |
| + setView(mCategoryView); |
| + } |
| + |
| + @Override |
| + protected void onCreate(Bundle savedInstanceState) { |
| + super.onCreate(savedInstanceState); |
| + |
| + getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
| + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, |
| + WindowManager.LayoutParams.FLAG_FULLSCREEN); |
| + } |
| +} |