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

Side by Side Diff: chrome/android/java/ResourceId.template

Issue 1384153003: Introduce a way to define Android-only IDR values that doesn't require (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: shortcircuit pointless lookup Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/app/theme/theme_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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; 5 package org.chromium.chrome.browser;
6 6
7 import org.chromium.chrome.R; 7 import org.chromium.chrome.R;
8 8
9 public class ResourceId { 9 public class ResourceId {
10 public static int mapToDrawableId(int enumeratedId) { 10 public static int mapToDrawableId(int enumeratedId) {
11 int[] resourceList = { 11 int[] resourceList = {
12 #define DEFINE_RESOURCE_ID(c_id,java_id) java_id, 12 #define LINK_RESOURCE_ID(c_id,java_id) java_id,
13 #define DECLARE_RESOURCE_ID(c_id,java_id) java_id,
13 #include "chrome/browser/android/resource_id.h" 14 #include "chrome/browser/android/resource_id.h"
14 }; 15 };
15 16
16 if (enumeratedId >= 0 && enumeratedId < resourceList.length) { 17 if (enumeratedId >= 0 && enumeratedId < resourceList.length) {
17 return resourceList[enumeratedId]; 18 return resourceList[enumeratedId];
18 } 19 }
19 20
20 assert false : "enumeratedId '" + enumeratedId + "' was out of range."; 21 assert false : "enumeratedId '" + enumeratedId + "' was out of range.";
21 return R.drawable.missing; 22 return R.drawable.missing;
22 } 23 }
23 } 24 }
OLDNEW
« no previous file with comments | « no previous file | chrome/app/theme/theme_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698