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

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

Issue 2854005: Enable policy support on the Linux platform. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Modify gypi file after removing chrome_paths_unittest. Created 10 years, 6 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
« no previous file with comments | « chrome/common/chrome_paths.h ('k') | no next file » | 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 break; 276 break;
277 case chrome::DIR_TEST_TOOLS: 277 case chrome::DIR_TEST_TOOLS:
278 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur)) 278 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur))
279 return false; 279 return false;
280 cur = cur.Append(FILE_PATH_LITERAL("chrome")); 280 cur = cur.Append(FILE_PATH_LITERAL("chrome"));
281 cur = cur.Append(FILE_PATH_LITERAL("tools")); 281 cur = cur.Append(FILE_PATH_LITERAL("tools"));
282 cur = cur.Append(FILE_PATH_LITERAL("test")); 282 cur = cur.Append(FILE_PATH_LITERAL("test"));
283 if (!file_util::PathExists(cur)) // we don't want to create this 283 if (!file_util::PathExists(cur)) // we don't want to create this
284 return false; 284 return false;
285 break; 285 break;
286 #if !defined(OS_MACOSX) && defined(OS_POSIX)
287 case chrome::DIR_POLICY_FILES: {
288 #if defined(GOOGLE_CHROME_BUILD)
289 cur = FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/policies"));
290 #else
291 cur = FilePath(FILE_PATH_LITERAL("/etc/chromium/policies"));
292 #endif
293 if (!file_util::PathExists(cur)) // we don't want to create this
294 return false;
295 break;
296 }
297 #endif
286 default: 298 default:
287 return false; 299 return false;
288 } 300 }
289 301
290 if (create_dir && !file_util::PathExists(cur) && 302 if (create_dir && !file_util::PathExists(cur) &&
291 !file_util::CreateDirectory(cur)) 303 !file_util::CreateDirectory(cur))
292 return false; 304 return false;
293 305
294 *result = cur; 306 *result = cur;
295 return true; 307 return true;
296 } 308 }
297 309
298 // This cannot be done as a static initializer sadly since Visual Studio will 310 // This cannot be done as a static initializer sadly since Visual Studio will
299 // eliminate this object file if there is no direct entry point into it. 311 // eliminate this object file if there is no direct entry point into it.
300 void RegisterPathProvider() { 312 void RegisterPathProvider() {
301 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 313 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
302 } 314 }
303 315
304 } // namespace chrome 316 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_paths.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698