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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 private List<String> mMimeTypes; | 124 private List<String> mMimeTypes; |
125 | 125 |
126 // A list of files to use for testing (instead of reading files on disk). | 126 // A list of files to use for testing (instead of reading files on disk). |
127 private static List<PickerBitmap> sTestFiles; | 127 private static List<PickerBitmap> sTestFiles; |
128 | 128 |
129 @SuppressWarnings("unchecked") // mSelectableListLayout | 129 @SuppressWarnings("unchecked") // mSelectableListLayout |
130 public PickerCategoryView(Context context) { | 130 public PickerCategoryView(Context context) { |
131 super(context); | 131 super(context); |
132 mActivity = (ChromeActivity) context; | 132 mActivity = (ChromeActivity) context; |
133 | 133 |
134 mDecoderServiceHost = new DecoderServiceHost(this); | 134 mDecoderServiceHost = new DecoderServiceHost(this, context); |
135 mDecoderServiceHost.bind(mActivity); | 135 mDecoderServiceHost.bind(context); |
136 | 136 |
137 mSelectionDelegate = new SelectionDelegate<PickerBitmap>(); | 137 mSelectionDelegate = new SelectionDelegate<PickerBitmap>(); |
138 | 138 |
139 View root = LayoutInflater.from(context).inflate(R.layout.photo_picker_d
ialog, this); | 139 View root = LayoutInflater.from(context).inflate(R.layout.photo_picker_d
ialog, this); |
140 mSelectableListLayout = | 140 mSelectableListLayout = |
141 (SelectableListLayout<PickerBitmap>) root.findViewById(R.id.sele
ctable_list); | 141 (SelectableListLayout<PickerBitmap>) root.findViewById(R.id.sele
ctable_list); |
142 | 142 |
143 mPickerAdapter = new PickerAdapter(this); | 143 mPickerAdapter = new PickerAdapter(this); |
144 mRecyclerView = mSelectableListLayout.initializeRecyclerView(mPickerAdap
ter); | 144 mRecyclerView = mSelectableListLayout.initializeRecyclerView(mPickerAdap
ter); |
145 PhotoPickerToolbar toolbar = (PhotoPickerToolbar) mSelectableListLayout.
initializeToolbar( | 145 PhotoPickerToolbar toolbar = (PhotoPickerToolbar) mSelectableListLayout.
initializeToolbar( |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 @VisibleForTesting | 438 @VisibleForTesting |
439 public static void setTestFiles(List<PickerBitmap> testFiles) { | 439 public static void setTestFiles(List<PickerBitmap> testFiles) { |
440 sTestFiles = new ArrayList<>(testFiles); | 440 sTestFiles = new ArrayList<>(testFiles); |
441 } | 441 } |
442 | 442 |
443 @VisibleForTesting | 443 @VisibleForTesting |
444 public SelectionDelegate<PickerBitmap> getSelectionDelegateForTesting() { | 444 public SelectionDelegate<PickerBitmap> getSelectionDelegateForTesting() { |
445 return mSelectionDelegate; | 445 return mSelectionDelegate; |
446 } | 446 } |
447 } | 447 } |
OLD | NEW |