| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 StringIntMap::const_iterator it = id_map_.find(resource_name); | 34 StringIntMap::const_iterator it = id_map_.find(resource_name); |
| 35 if (it == id_map_.end()) | 35 if (it == id_map_.end()) |
| 36 return -1; | 36 return -1; |
| 37 return it->second; | 37 return it->second; |
| 38 } | 38 } |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 StringIntMap id_map_; | 41 StringIntMap id_map_; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 static base::LazyInstance<ThemeMap> g_theme_ids(base::LINKER_INITIALIZED); | 44 static base::LazyInstance<ThemeMap> g_theme_ids = LAZY_INSTANCE_INITIALIZER; |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 int ResourcesUtil::GetThemeResourceId(const std::string& resource_name) { | 48 int ResourcesUtil::GetThemeResourceId(const std::string& resource_name) { |
| 49 return g_theme_ids.Get().GetId(resource_name); | 49 return g_theme_ids.Get().GetId(resource_name); |
| 50 } | 50 } |
| OLD | NEW |