OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.compositor.resources; |
| 6 |
| 7 import android.content.Context; |
| 8 |
| 9 import com.google.android.apps.chrome.R; |
| 10 |
| 11 import org.chromium.base.annotations.SuppressFBWarnings; |
| 12 import org.chromium.ui.base.DeviceFormFactor; |
| 13 |
| 14 /** |
| 15 * Tracks all high priority resources that should be loaded at startup to be use
d by CC layers. |
| 16 * TODO(dtrainor): Add the high priority and low priority resources here as they
get ported over. |
| 17 */ |
| 18 public class StaticResourcePreloads { |
| 19 /** A list of resources to load synchronously once the compositor is initial
ized. */ |
| 20 private static int[] sSynchronousResources = new int[] { |
| 21 R.drawable.bg_tabstrip_tab, R.drawable.bg_tabstrip_background_tab, |
| 22 R.drawable.btn_tab_close_normal, R.drawable.btn_tab_close_white_norm
al, |
| 23 R.drawable.btn_tab_close_pressed, R.drawable.btn_tabstrip_new_tab_no
rmal, |
| 24 R.drawable.btn_tabstrip_new_incognito_tab_normal, |
| 25 R.drawable.btn_tabstrip_new_tab_pressed, R.drawable.spinner, R.drawa
ble.spinner_white, |
| 26 }; |
| 27 |
| 28 /** A list of resources to load asynchronously once the compositor is initia
lized. */ |
| 29 private static int[] sAsynchronousResources = new int[] {R.drawable.logo_car
d_back, |
| 30 R.drawable.btn_tabstrip_switch_normal, R.drawable.btn_tabstrip_switc
h_incognito}; |
| 31 |
| 32 private static int[] sEmptyList = new int[] {}; |
| 33 |
| 34 public static int[] getSynchronousResources(Context context) { |
| 35 return DeviceFormFactor.isTablet(context) ? sSynchronousResources : sEmp
tyList; |
| 36 } |
| 37 |
| 38 @SuppressFBWarnings("MS_EXPOSE_REP") |
| 39 public static int[] getAsynchronousResources() { |
| 40 return sAsynchronousResources; |
| 41 } |
| 42 } |
OLD | NEW |