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

Side by Side Diff: ui/display/manager/display_pref_util.h

Issue 2733313002: Move display preference code from ash/display/ to ui/display/manager/. (Closed)
Patch Set: Rebase. Created 3 years, 9 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 | « ui/display/manager/BUILD.gn ('k') | ui/display/manager/json_converter.h » ('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 (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 UI_DISPLAY_MANAGER_DISPLAY_PREF_UTIL_H
6 #define ASH_DISPLAY_DISPLAY_PREF_UTIL_H 6 #define UI_DISPLAY_MANAGER_DISPLAY_PREF_UTIL_H
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/strings/string_piece.h" 11 #include "base/strings/string_piece.h"
12 12
13 namespace ash { 13 namespace display {
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, 18 std::map<T, std::string>* CreateToStringMap(T k1,
19 const std::string& v1, 19 const std::string& v1,
20 T k2, 20 T k2,
21 const std::string& v2, 21 const std::string& v2,
22 T k3, 22 T k3,
23 const std::string& v3, 23 const std::string& v3,
(...skipping 28 matching lines...) Expand all
52 typename std::map<T, std::string>::const_iterator iter = map->begin(); 52 typename std::map<T, std::string>::const_iterator iter = map->begin();
53 for (; iter != map->end(); ++iter) { 53 for (; iter != map->end(); ++iter) {
54 if (iter->second == value) { 54 if (iter->second == value) {
55 *key = iter->first; 55 *key = iter->first;
56 return true; 56 return true;
57 } 57 }
58 } 58 }
59 return false; 59 return false;
60 } 60 }
61 61
62 } // namespace ash 62 } // namespace display
63 63
64 #endif // ASH_DISPLAY_DISPLAY_PREF_UTIL_H 64 #endif // UI_DISPLAY_MANAGER_DISPLAY_PREF_UTIL_H
OLDNEW
« no previous file with comments | « ui/display/manager/BUILD.gn ('k') | ui/display/manager/json_converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698