| 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.content.DialogInterface; | 8 import android.content.DialogInterface; |
| 9 import android.content.res.Configuration; | 9 import android.content.res.Configuration; |
| 10 import android.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 private List<String> mMimeTypes; | 118 private List<String> mMimeTypes; |
| 119 | 119 |
| 120 // A list of files to use for testing (instead of reading files on disk). | 120 // A list of files to use for testing (instead of reading files on disk). |
| 121 private static List<PickerBitmap> sTestFiles; | 121 private static List<PickerBitmap> sTestFiles; |
| 122 | 122 |
| 123 @SuppressWarnings("unchecked") // mSelectableListLayout | 123 @SuppressWarnings("unchecked") // mSelectableListLayout |
| 124 public PickerCategoryView(Context context) { | 124 public PickerCategoryView(Context context) { |
| 125 super(context); | 125 super(context); |
| 126 mActivity = (ChromeActivity) context; | 126 mActivity = (ChromeActivity) context; |
| 127 | 127 |
| 128 mDecoderServiceHost = new DecoderServiceHost(this); | 128 mDecoderServiceHost = new DecoderServiceHost(this, context); |
| 129 mDecoderServiceHost.bind(mActivity); | 129 mDecoderServiceHost.bind(context); |
| 130 | 130 |
| 131 mSelectionDelegate = new SelectionDelegate<PickerBitmap>(); | 131 mSelectionDelegate = new SelectionDelegate<PickerBitmap>(); |
| 132 | 132 |
| 133 View root = LayoutInflater.from(context).inflate(R.layout.photo_picker_d
ialog, this); | 133 View root = LayoutInflater.from(context).inflate(R.layout.photo_picker_d
ialog, this); |
| 134 mSelectableListLayout = | 134 mSelectableListLayout = |
| 135 (SelectableListLayout<PickerBitmap>) root.findViewById(R.id.sele
ctable_list); | 135 (SelectableListLayout<PickerBitmap>) root.findViewById(R.id.sele
ctable_list); |
| 136 | 136 |
| 137 mPickerAdapter = new PickerAdapter(this); | 137 mPickerAdapter = new PickerAdapter(this); |
| 138 mRecyclerView = mSelectableListLayout.initializeRecyclerView(mPickerAdap
ter); | 138 mRecyclerView = mSelectableListLayout.initializeRecyclerView(mPickerAdap
ter); |
| 139 PhotoPickerToolbar toolbar = (PhotoPickerToolbar) mSelectableListLayout.
initializeToolbar( | 139 PhotoPickerToolbar toolbar = (PhotoPickerToolbar) mSelectableListLayout.
initializeToolbar( |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 @VisibleForTesting | 421 @VisibleForTesting |
| 422 public static void setTestFiles(List<PickerBitmap> testFiles) { | 422 public static void setTestFiles(List<PickerBitmap> testFiles) { |
| 423 sTestFiles = new ArrayList<>(testFiles); | 423 sTestFiles = new ArrayList<>(testFiles); |
| 424 } | 424 } |
| 425 | 425 |
| 426 @VisibleForTesting | 426 @VisibleForTesting |
| 427 public SelectionDelegate<PickerBitmap> getSelectionDelegateForTesting() { | 427 public SelectionDelegate<PickerBitmap> getSelectionDelegateForTesting() { |
| 428 return mSelectionDelegate; | 428 return mSelectionDelegate; |
| 429 } | 429 } |
| 430 } | 430 } |
| OLD | NEW |