OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/resources_util.h" | 5 #include "chrome/browser/resources_util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 StringIntMap::const_iterator it = id_map_.find(resource_name); | 47 StringIntMap::const_iterator it = id_map_.find(resource_name); |
48 if (it == id_map_.end()) | 48 if (it == id_map_.end()) |
49 return -1; | 49 return -1; |
50 return it->second; | 50 return it->second; |
51 } | 51 } |
52 | 52 |
53 private: | 53 private: |
54 StringIntMap id_map_; | 54 StringIntMap id_map_; |
55 }; | 55 }; |
56 | 56 |
57 static base::LazyInstance<ThemeMap> g_theme_ids = LAZY_INSTANCE_INITIALIZER; | 57 static base::LazyInstance<ThemeMap>::DestructorAtExit g_theme_ids = |
| 58 LAZY_INSTANCE_INITIALIZER; |
58 | 59 |
59 } // namespace | 60 } // namespace |
60 | 61 |
61 int ResourcesUtil::GetThemeResourceId(const std::string& resource_name) { | 62 int ResourcesUtil::GetThemeResourceId(const std::string& resource_name) { |
62 return g_theme_ids.Get().GetId(resource_name); | 63 return g_theme_ids.Get().GetId(resource_name); |
63 } | 64 } |
OLD | NEW |