Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: chrome/android/java/ResourceID.template

Issue 14772036: Let Android port access properly sized images (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed header guard comment Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..de3951b0e77a9f6e0315755f3dc5dbb18b9b3e04
--- /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];
+ } else {
Yaron 2013/05/17 22:36:16 No need for "else" since you return above.
gone 2013/05/20 18:48:10 Done.
+ assert false : "enumeratedID was out of range.";
Yaron 2013/05/17 22:36:16 add the failing id to the string?
gone 2013/05/20 18:48:10 Done.
+ return R.drawable.missing;
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698