OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef ASH_DISPLAY_DISPLAY_PREF_UTIL_H | 5 #ifndef ASH_DISPLAY_DISPLAY_PREF_UTIL_H |
6 #define ASH_DISPLAY_DISPLAY_PREF_UTIL_H | 6 #define ASH_DISPLAY_DISPLAY_PREF_UTIL_H |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/string_piece.h" | 11 #include "base/strings/string_piece.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 // Utility templates to create enum to string map and | 15 // Utility templates to create enum to string map and |
16 // a function to find an enum value from a string. | 16 // a function to find an enum value from a string. |
17 template<typename T> | 17 template<typename T> |
18 std::map<T, std::string>* CreateToStringMap(T k1, const std::string& v1, | 18 std::map<T, std::string>* CreateToStringMap(T k1, const std::string& v1, |
19 T k2, const std::string& v2, | 19 T k2, const std::string& v2, |
20 T k3, const std::string& v3, | 20 T k3, const std::string& v3, |
21 T k4, const std::string& v4) { | 21 T k4, const std::string& v4) { |
(...skipping 17 matching lines...) Expand all Loading... |
39 *key = iter->first; | 39 *key = iter->first; |
40 return true; | 40 return true; |
41 } | 41 } |
42 } | 42 } |
43 return false; | 43 return false; |
44 } | 44 } |
45 | 45 |
46 } // namespace ash | 46 } // namespace ash |
47 | 47 |
48 #endif // ASH_DISPLAY_DISPLAY_PREF_UTIL_H | 48 #endif // ASH_DISPLAY_DISPLAY_PREF_UTIL_H |
OLD | NEW |