Index: chrome/android/java/ResourceId.template |
diff --git a/chrome/android/java/ResourceId.template b/chrome/android/java/ResourceId.template |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4894b5c47bf07880b84ad10482e7ea5d7e5a0476 |
--- /dev/null |
+++ b/chrome/android/java/ResourceId.template |
@@ -0,0 +1,23 @@ |
+// 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 DEFINE_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; |
+ } |
+} |