• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_ANDROID_RESOURCE_MAPPER_H_
6 #define CHROME_BROWSER_ANDROID_RESOURCE_MAPPER_H_
7 
8 #include <map>
9 
10 // Enumerates IDs of resources used in the Android port of Chromium.  This is
11 // needed so that Android knows which Drawable is needed in the Java UI.
12 class ResourceMapper {
13  public:
14   // ID indicating that the map failed to find a Drawable corresponding to the
15   // Chromium resource.
16   static const int kMissingId;
17 
18   // Converts the given chromium |resource_id| (e.g. IDR_INFOBAR_TRANSLATE) to
19   // an enumerated ID.  Returns |kMissingId| if a mapping wasn't found.
20   static int MapFromChromiumId(int resource_id);
21 
22  private:
23   // Create the mapping.  IDs start at 0 to correspond to the array that gets
24   // built in the corresponding ResourceID Java class.
25   static void ConstructMap();
26 };
27 
28 #endif  // CHROME_BROWSER_ANDROID_RESOURCE_MAPPER_H_
29