OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/common/chrome_paths.h" | 5 #include "chrome/common/chrome_paths.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 return false; | 85 return false; |
86 cur = cur.Append(FILE_PATH_LITERAL("resources")); | 86 cur = cur.Append(FILE_PATH_LITERAL("resources")); |
87 create_dir = true; | 87 create_dir = true; |
88 break; | 88 break; |
89 case chrome::DIR_INSPECTOR: | 89 case chrome::DIR_INSPECTOR: |
90 if (!PathService::Get(chrome::DIR_APP, &cur)) | 90 if (!PathService::Get(chrome::DIR_APP, &cur)) |
91 return false; | 91 return false; |
92 cur = cur.Append(FILE_PATH_LITERAL("resources")); | 92 cur = cur.Append(FILE_PATH_LITERAL("resources")); |
93 cur = cur.Append(FILE_PATH_LITERAL("inspector")); | 93 cur = cur.Append(FILE_PATH_LITERAL("inspector")); |
94 break; | 94 break; |
95 case chrome::DIR_THEMES: | |
96 if (!PathService::Get(chrome::DIR_APP, &cur)) | |
97 return false; | |
98 cur = cur.Append(FILE_PATH_LITERAL("themes")); | |
99 create_dir = true; | |
100 break; | |
101 case chrome::DIR_LOCALES: | |
102 if (!PathService::Get(chrome::DIR_APP, &cur)) | |
103 return false; | |
104 #if defined(OS_MACOSX) | |
105 // On Mac, locale files are in Contents/Resources, a sibling of the | |
106 // App dir. | |
107 cur = cur.DirName(); | |
108 cur = cur.Append(FILE_PATH_LITERAL("Resources")); | |
109 #else | |
110 cur = cur.Append(FILE_PATH_LITERAL("locales")); | |
111 #endif | |
112 create_dir = true; | |
113 break; | |
114 case chrome::DIR_APP_DICTIONARIES: | 95 case chrome::DIR_APP_DICTIONARIES: |
115 #if defined(OS_LINUX) | 96 #if defined(OS_LINUX) |
116 // We can't write into the EXE dir on Linux, so keep dictionaries | 97 // We can't write into the EXE dir on Linux, so keep dictionaries |
117 // alongside the safe browsing database in the user data dir. | 98 // alongside the safe browsing database in the user data dir. |
118 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 99 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
119 return false; | 100 return false; |
120 #else | 101 #else |
121 if (!PathService::Get(base::DIR_EXE, &cur)) | 102 if (!PathService::Get(base::DIR_EXE, &cur)) |
122 return false; | 103 return false; |
123 #endif | 104 #endif |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 return true; | 191 return true; |
211 } | 192 } |
212 | 193 |
213 // This cannot be done as a static initializer sadly since Visual Studio will | 194 // This cannot be done as a static initializer sadly since Visual Studio will |
214 // eliminate this object file if there is no direct entry point into it. | 195 // eliminate this object file if there is no direct entry point into it. |
215 void RegisterPathProvider() { | 196 void RegisterPathProvider() { |
216 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 197 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
217 } | 198 } |
218 | 199 |
219 } // namespace chrome | 200 } // namespace chrome |
OLD | NEW |