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

Side by Side Diff: chrome/common/chrome_paths.cc

Issue 4062002: Dynamic policy refresh support for the Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/map/list/, nits. Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/chrome_paths.h ('k') | chrome/common/chrome_paths_internal.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) 2006-2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2010 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_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 #if defined(GOOGLE_CHROME_BUILD) 288 #if defined(GOOGLE_CHROME_BUILD)
289 cur = FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/policies")); 289 cur = FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/policies"));
290 #else 290 #else
291 cur = FilePath(FILE_PATH_LITERAL("/etc/chromium/policies")); 291 cur = FilePath(FILE_PATH_LITERAL("/etc/chromium/policies"));
292 #endif 292 #endif
293 if (!file_util::PathExists(cur)) // we don't want to create this 293 if (!file_util::PathExists(cur)) // we don't want to create this
294 return false; 294 return false;
295 break; 295 break;
296 } 296 }
297 #endif 297 #endif
298 #if defined(OS_MACOSX)
299 case chrome::DIR_MANAGED_PREFS: {
300 if (!GetLocalLibraryDirectory(&cur))
301 return false;
302 cur = cur.Append(FILE_PATH_LITERAL("Managed Preferences"));
303 char* login = getlogin();
304 if (!login)
305 return false;
306 cur = cur.AppendASCII(login);
307 if (!file_util::PathExists(cur)) // we don't want to create this
308 return false;
309 break;
310 }
311 #endif
298 default: 312 default:
299 return false; 313 return false;
300 } 314 }
301 315
302 if (create_dir && !file_util::PathExists(cur) && 316 if (create_dir && !file_util::PathExists(cur) &&
303 !file_util::CreateDirectory(cur)) 317 !file_util::CreateDirectory(cur))
304 return false; 318 return false;
305 319
306 *result = cur; 320 *result = cur;
307 return true; 321 return true;
308 } 322 }
309 323
310 // This cannot be done as a static initializer sadly since Visual Studio will 324 // This cannot be done as a static initializer sadly since Visual Studio will
311 // eliminate this object file if there is no direct entry point into it. 325 // eliminate this object file if there is no direct entry point into it.
312 void RegisterPathProvider() { 326 void RegisterPathProvider() {
313 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 327 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
314 } 328 }
315 329
316 } // namespace chrome 330 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_paths.h ('k') | chrome/common/chrome_paths_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698