| 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..bc8ea4a161484e63c646d37a594697f5c09f6fb4
|
| --- /dev/null
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PhotoPickerDialog.java
|
| @@ -0,0 +1,48 @@
|
| +// 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.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);
|
| + }
|
| +}
|
|
|