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 "base/path_service.h" | 5 #include "base/path_service.h" |
6 | 6 |
7 #ifdef OS_WIN | 7 #ifdef OS_WIN |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 28 matching lines...) Expand all Loading... |
39 struct Provider { | 39 struct Provider { |
40 PathService::ProviderFunc func; | 40 PathService::ProviderFunc func; |
41 struct Provider* next; | 41 struct Provider* next; |
42 #ifndef NDEBUG | 42 #ifndef NDEBUG |
43 int key_start; | 43 int key_start; |
44 int key_end; | 44 int key_end; |
45 #endif | 45 #endif |
46 bool is_static; | 46 bool is_static; |
47 }; | 47 }; |
48 | 48 |
49 static Provider base_provider = { | 49 Provider base_provider = { |
50 base::PathProvider, | 50 base::PathProvider, |
51 NULL, | 51 NULL, |
52 #ifndef NDEBUG | 52 #ifndef NDEBUG |
53 base::PATH_START, | 53 base::PATH_START, |
54 base::PATH_END, | 54 base::PATH_END, |
55 #endif | 55 #endif |
56 true | 56 true |
57 }; | 57 }; |
58 | 58 |
59 #if defined(OS_WIN) | 59 #if defined(OS_WIN) |
60 static Provider base_provider_win = { | 60 Provider base_provider_win = { |
61 base::PathProviderWin, | 61 base::PathProviderWin, |
62 &base_provider, | 62 &base_provider, |
63 #ifndef NDEBUG | 63 #ifndef NDEBUG |
64 base::PATH_WIN_START, | 64 base::PATH_WIN_START, |
65 base::PATH_WIN_END, | 65 base::PATH_WIN_END, |
66 #endif | 66 #endif |
67 true | 67 true |
68 }; | 68 }; |
69 #endif | 69 #endif |
70 | 70 |
71 #if defined(OS_MACOSX) | 71 #if defined(OS_MACOSX) |
72 static Provider base_provider_mac = { | 72 Provider base_provider_mac = { |
73 base::PathProviderMac, | 73 base::PathProviderMac, |
74 &base_provider, | 74 &base_provider, |
75 #ifndef NDEBUG | 75 #ifndef NDEBUG |
76 base::PATH_MAC_START, | 76 base::PATH_MAC_START, |
77 base::PATH_MAC_END, | 77 base::PATH_MAC_END, |
78 #endif | 78 #endif |
79 true | 79 true |
80 }; | 80 }; |
81 #endif | 81 #endif |
82 | 82 |
83 #if defined(OS_ANDROID) | 83 #if defined(OS_ANDROID) |
84 static Provider base_provider_android = { | 84 Provider base_provider_android = { |
85 base::PathProviderAndroid, | 85 base::PathProviderAndroid, |
86 &base_provider, | 86 &base_provider, |
87 #ifndef NDEBUG | 87 #ifndef NDEBUG |
88 0, | 88 0, |
89 0, | 89 0, |
90 #endif | 90 #endif |
91 true | 91 true |
92 }; | 92 }; |
93 #endif | 93 #endif |
94 | 94 |
95 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 95 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
96 static Provider base_provider_posix = { | 96 Provider base_provider_posix = { |
97 base::PathProviderPosix, | 97 base::PathProviderPosix, |
98 &base_provider, | 98 &base_provider, |
99 #ifndef NDEBUG | 99 #ifndef NDEBUG |
100 0, | 100 0, |
101 0, | 101 0, |
102 #endif | 102 #endif |
103 true | 103 true |
104 }; | 104 }; |
105 #endif | 105 #endif |
106 | 106 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 p = new Provider; | 275 p = new Provider; |
276 p->is_static = false; | 276 p->is_static = false; |
277 p->func = func; | 277 p->func = func; |
278 p->next = path_data->providers; | 278 p->next = path_data->providers; |
279 #ifndef NDEBUG | 279 #ifndef NDEBUG |
280 p->key_start = key_start; | 280 p->key_start = key_start; |
281 p->key_end = key_end; | 281 p->key_end = key_end; |
282 #endif | 282 #endif |
283 path_data->providers = p; | 283 path_data->providers = p; |
284 } | 284 } |
OLD | NEW |