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

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

Issue 12183017: Verify the signature on user cloud policy downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/chrome_paths.h ('k') | net/tools/testserver/device_management.py » ('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) 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/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ 86 // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/
87 const char kFilepathSinglePrefExtensions[] = 87 const char kFilepathSinglePrefExtensions[] =
88 #if defined(GOOGLE_CHROME_BUILD) 88 #if defined(GOOGLE_CHROME_BUILD)
89 FILE_PATH_LITERAL("/usr/share/google-chrome/extensions"); 89 FILE_PATH_LITERAL("/usr/share/google-chrome/extensions");
90 #else 90 #else
91 FILE_PATH_LITERAL("/usr/share/chromium/extensions"); 91 FILE_PATH_LITERAL("/usr/share/chromium/extensions");
92 #endif // defined(GOOGLE_CHROME_BUILD) 92 #endif // defined(GOOGLE_CHROME_BUILD)
93 #endif // defined(OS_LINUX) 93 #endif // defined(OS_LINUX)
94 94
95 #if defined(OS_CHROMEOS) 95 #if defined(OS_CHROMEOS)
96
96 const char kDefaultAppOrderFileName[] = 97 const char kDefaultAppOrderFileName[] =
97 #if defined(GOOGLE_CHROME_BUILD) 98 #if defined(GOOGLE_CHROME_BUILD)
98 FILE_PATH_LITERAL("/usr/share/google-chrome/default_app_order.json"); 99 FILE_PATH_LITERAL("/usr/share/google-chrome/default_app_order.json");
99 #else 100 #else
100 FILE_PATH_LITERAL("/usr/share/chromium/default_app_order.json"); 101 FILE_PATH_LITERAL("/usr/share/chromium/default_app_order.json");
101 #endif // defined(GOOGLE_CHROME_BUILD) 102 #endif // defined(GOOGLE_CHROME_BUILD)
103
104 const FilePath::CharType kDefaultUserPolicyKeysDir[] =
105 FILE_PATH_LITERAL("/var/run/user_policy");
106
102 #endif // defined(OS_CHROMEOS) 107 #endif // defined(OS_CHROMEOS)
103 108
104 } // namespace 109 } // namespace
105 110
106 namespace chrome { 111 namespace chrome {
107 112
108 // Gets the path for internal plugins. 113 // Gets the path for internal plugins.
109 bool GetInternalPluginsDirectory(base::FilePath* result) { 114 bool GetInternalPluginsDirectory(base::FilePath* result) {
110 #if defined(OS_MACOSX) && !defined(OS_IOS) 115 #if defined(OS_MACOSX) && !defined(OS_IOS)
111 // If called from Chrome, get internal plugins from a subdirectory of the 116 // If called from Chrome, get internal plugins from a subdirectory of the
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 cur = cur.Append(FILE_PATH_LITERAL("wallpaper_thumbnails")); 403 cur = cur.Append(FILE_PATH_LITERAL("wallpaper_thumbnails"));
399 break; 404 break;
400 case chrome::DIR_CHROMEOS_CUSTOM_WALLPAPERS: 405 case chrome::DIR_CHROMEOS_CUSTOM_WALLPAPERS:
401 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) 406 if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
402 return false; 407 return false;
403 cur = cur.Append(FILE_PATH_LITERAL("custom_wallpapers")); 408 cur = cur.Append(FILE_PATH_LITERAL("custom_wallpapers"));
404 break; 409 break;
405 case chrome::FILE_DEFAULT_APP_ORDER: 410 case chrome::FILE_DEFAULT_APP_ORDER:
406 cur = base::FilePath(FILE_PATH_LITERAL(kDefaultAppOrderFileName)); 411 cur = base::FilePath(FILE_PATH_LITERAL(kDefaultAppOrderFileName));
407 break; 412 break;
413 case chrome::DIR_USER_POLICY_KEYS:
414 cur = FilePath(kDefaultUserPolicyKeysDir);
415 break;
408 #endif 416 #endif
409 // The following are only valid in the development environment, and 417 // The following are only valid in the development environment, and
410 // will fail if executed from an installed executable (because the 418 // will fail if executed from an installed executable (because the
411 // generated path won't exist). 419 // generated path won't exist).
412 case chrome::DIR_GEN_TEST_DATA: 420 case chrome::DIR_GEN_TEST_DATA:
413 if (!PathService::Get(base::DIR_MODULE, &cur)) 421 if (!PathService::Get(base::DIR_MODULE, &cur))
414 return false; 422 return false;
415 cur = cur.Append(FILE_PATH_LITERAL("test_data")); 423 cur = cur.Append(FILE_PATH_LITERAL("test_data"));
416 if (!file_util::PathExists(cur)) // We don't want to create this. 424 if (!file_util::PathExists(cur)) // We don't want to create this.
417 return false; 425 return false;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 return true; 521 return true;
514 } 522 }
515 523
516 // This cannot be done as a static initializer sadly since Visual Studio will 524 // This cannot be done as a static initializer sadly since Visual Studio will
517 // eliminate this object file if there is no direct entry point into it. 525 // eliminate this object file if there is no direct entry point into it.
518 void RegisterPathProvider() { 526 void RegisterPathProvider() {
519 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 527 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
520 } 528 }
521 529
522 } // namespace chrome 530 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_paths.h ('k') | net/tools/testserver/device_management.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698