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

Side by Side Diff: content/browser/accessibility/accessibility_tree_formatter_utils_win.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
OLDNEW
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 "content/browser/accessibility/accessibility_tree_formatter_utils_win.h " 5 #include "content/browser/accessibility/accessibility_tree_formatter_utils_win.h "
6 6
7 #include <oleacc.h> 7 #include <oleacc.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 13 matching lines...) Expand all
24 std::map<int32, base::string16> ia_role_string_map; 24 std::map<int32, base::string16> ia_role_string_map;
25 std::map<int32, base::string16> ia2_role_string_map; 25 std::map<int32, base::string16> ia2_role_string_map;
26 std::map<int32, base::string16> ia_state_string_map; 26 std::map<int32, base::string16> ia_state_string_map;
27 std::map<int32, base::string16> ia2_state_string_map; 27 std::map<int32, base::string16> ia2_state_string_map;
28 std::map<int32, base::string16> event_string_map; 28 std::map<int32, base::string16> event_string_map;
29 29
30 private: 30 private:
31 AccessibilityEnumMap(); 31 AccessibilityEnumMap();
32 virtual ~AccessibilityEnumMap() {} 32 virtual ~AccessibilityEnumMap() {}
33 33
34 friend struct DefaultSingletonTraits<AccessibilityEnumMap>; 34 friend struct base::DefaultSingletonTraits<AccessibilityEnumMap>;
35 35
36 DISALLOW_COPY_AND_ASSIGN(AccessibilityEnumMap); 36 DISALLOW_COPY_AND_ASSIGN(AccessibilityEnumMap);
37 }; 37 };
38 38
39 // static 39 // static
40 AccessibilityEnumMap* AccessibilityEnumMap::GetInstance() { 40 AccessibilityEnumMap* AccessibilityEnumMap::GetInstance() {
41 return Singleton<AccessibilityEnumMap, 41 return base::Singleton<
42 LeakySingletonTraits<AccessibilityEnumMap> >::get(); 42 AccessibilityEnumMap,
43 base::LeakySingletonTraits<AccessibilityEnumMap>>::get();
43 } 44 }
44 45
45 AccessibilityEnumMap::AccessibilityEnumMap() { 46 AccessibilityEnumMap::AccessibilityEnumMap() {
46 // Convenience macros for generating readable strings. 47 // Convenience macros for generating readable strings.
47 #define IA_ROLE_MAP(x) ia_role_string_map[x] = L###x; \ 48 #define IA_ROLE_MAP(x) ia_role_string_map[x] = L###x; \
48 ia2_role_string_map[x] = L###x; 49 ia2_role_string_map[x] = L###x;
49 #define IA2_ROLE_MAP(x) ia2_role_string_map[x] = L###x; 50 #define IA2_ROLE_MAP(x) ia2_role_string_map[x] = L###x;
50 #define IA_STATE_MAP(x) ia_state_string_map[STATE_SYSTEM_##x] = L###x; 51 #define IA_STATE_MAP(x) ia_state_string_map[STATE_SYSTEM_##x] = L###x;
51 #define IA2_STATE_MAP(x) ia2_state_string_map[x] = L###x; 52 #define IA2_STATE_MAP(x) ia2_state_string_map[x] = L###x;
52 #define EVENT_MAP(x) event_string_map[x] = L###x; 53 #define EVENT_MAP(x) event_string_map[x] = L###x;
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 std::vector<base::string16> strings; 334 std::vector<base::string16> strings;
334 IAccessible2StateToStringVector(ia2_state, &strings); 335 IAccessible2StateToStringVector(ia2_state, &strings);
335 return base::JoinString(strings, base::ASCIIToUTF16(",")); 336 return base::JoinString(strings, base::ASCIIToUTF16(","));
336 } 337 }
337 338
338 base::string16 AccessibilityEventToString(int32 event_id) { 339 base::string16 AccessibilityEventToString(int32 event_id) {
339 return AccessibilityEnumMap::GetInstance()->event_string_map[event_id]; 340 return AccessibilityEnumMap::GetInstance()->event_string_map[event_id];
340 } 341 }
341 342
342 } // namespace content 343 } // namespace content
OLDNEW
« no previous file with comments | « components/wifi_sync/wifi_credential_syncable_service_factory.cc ('k') | content/browser/accessibility/ax_tree_id_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698