| // Copyright 2013 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; |
| |
| import org.chromium.chrome.R; |
| |
| public class ResourceId { |
| public static int mapToDrawableId(int enumeratedId) { |
| int[] resourceList = { |
| #define LINK_RESOURCE_ID(c_id,java_id) java_id, |
| #define DECLARE_RESOURCE_ID(c_id,java_id) java_id, |
| #include "chrome/browser/android/resource_id.h" |
| }; |
| |
| if (enumeratedId >= 0 && enumeratedId < resourceList.length) { |
| return resourceList[enumeratedId]; |
| } |
| |
| assert false : "enumeratedId '" + enumeratedId + "' was out of range."; |
| return R.drawable.missing; |
| } |
| } |