Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/files/file_path.h" | |
| 6 #include "base/files/file_util.h" | |
| 7 #include "base/mac/foundation_util.h" | |
| 8 | |
| 9 namespace remoting { | |
| 10 namespace policy_hack { | |
| 11 | |
| 12 // This function is based on handling of DIR_MANAGED_PREFS key by | |
| 13 // PathService::Get in chrome/common/chrome_paths.cc. | |
|
Mattias Nissler (ping if slow)
2015/01/06 09:06:12
It might be cleaner to move DIR_MANAGED_PREFS over
Łukasz Anforowicz
2015/01/07 17:54:15
Since DIR_MANAGED_PREFS was used only GetManagedPo
Mattias Nissler (ping if slow)
2015/01/08 09:58:36
For background, a common use for using path keys i
Łukasz Anforowicz
2015/01/08 23:09:26
Thanks for the explanation. I see that the PathSe
| |
| 14 bool GetManagedPrefsDir(base::FilePath* result) { | |
| 15 base::FilePath cur; | |
| 16 if (!base::mac::GetLocalDirectory(NSLibraryDirectory, &cur)) { | |
| 17 return false; | |
| 18 } | |
| 19 cur = cur.Append(FILE_PATH_LITERAL("Managed Preferences")); | |
| 20 char* login = getlogin(); | |
| 21 if (!login) | |
| 22 return false; | |
| 23 cur = cur.AppendASCII(login); | |
| 24 if (!base::PathExists(cur)) // We don't want to create this. | |
|
Mattias Nissler (ping if slow)
2015/01/06 09:06:12
nit: This comment is a copy-and-paste artifact tha
Łukasz Anforowicz
2015/01/07 17:54:15
I don't understand. This is indeed a copy&pasted
Mattias Nissler (ping if slow)
2015/01/08 09:58:36
IIRC, in the path resolution logic the return valu
Łukasz Anforowicz
2015/01/08 23:09:26
A comment for PathService::Get from base/path_serv
| |
| 25 return false; | |
| 26 | |
| 27 *result = cur; | |
| 28 return true; | |
| 29 } | |
| 30 | |
| 31 } // namespace policy_hack | |
| 32 } // namespace remoting | |
| OLD | NEW |