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

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

Issue 830193002: Using PolicyServiceWatcher instead of PolicyWatcherLinux/Win/Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed code review feedback from Sergey. Created 5 years, 11 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 "chrome/common/chrome_paths.h" 5 #include "chrome/common/chrome_paths.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/bundle_locations.h" 10 #include "base/mac/bundle_locations.h"
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 case chrome::DIR_POLICY_FILES: { 465 case chrome::DIR_POLICY_FILES: {
466 #if defined(GOOGLE_CHROME_BUILD) 466 #if defined(GOOGLE_CHROME_BUILD)
467 cur = base::FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/policies")); 467 cur = base::FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/policies"));
468 #else 468 #else
469 cur = base::FilePath(FILE_PATH_LITERAL("/etc/chromium/policies")); 469 cur = base::FilePath(FILE_PATH_LITERAL("/etc/chromium/policies"));
470 #endif 470 #endif
471 break; 471 break;
472 } 472 }
473 #endif 473 #endif
474 #if defined(OS_MACOSX) && !defined(OS_IOS) 474 #if defined(OS_MACOSX) && !defined(OS_IOS)
475 case chrome::DIR_MANAGED_PREFS: {
476 if (!GetLocalLibraryDirectory(&cur))
477 return false;
478 cur = cur.Append(FILE_PATH_LITERAL("Managed Preferences"));
479 char* login = getlogin();
480 if (!login)
481 return false;
482 cur = cur.AppendASCII(login);
483 if (!base::PathExists(cur)) // We don't want to create this.
484 return false;
485 break;
486 }
487 case chrome::DIR_USER_LIBRARY: { 475 case chrome::DIR_USER_LIBRARY: {
488 if (!GetUserLibraryDirectory(&cur)) 476 if (!GetUserLibraryDirectory(&cur))
489 return false; 477 return false;
490 if (!base::PathExists(cur)) // We don't want to create this. 478 if (!base::PathExists(cur)) // We don't want to create this.
491 return false; 479 return false;
492 break; 480 break;
493 } 481 }
494 case chrome::DIR_USER_APPLICATIONS: { 482 case chrome::DIR_USER_APPLICATIONS: {
495 if (!GetUserApplicationsDirectory(&cur)) 483 if (!GetUserApplicationsDirectory(&cur))
496 return false; 484 return false;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 587
600 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { 588 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) {
601 g_invalid_specified_user_data_dir.Get() = user_data_dir; 589 g_invalid_specified_user_data_dir.Get() = user_data_dir;
602 } 590 }
603 591
604 const base::FilePath& GetInvalidSpecifiedUserDataDir() { 592 const base::FilePath& GetInvalidSpecifiedUserDataDir() {
605 return g_invalid_specified_user_data_dir.Get(); 593 return g_invalid_specified_user_data_dir.Get();
606 } 594 }
607 595
608 } // namespace chrome 596 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698