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

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, addressed latest comments 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
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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) 396 if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
392 return false; 397 return false;
393 cur = cur.Append(FILE_PATH_LITERAL("wallpapers")); 398 cur = cur.Append(FILE_PATH_LITERAL("wallpapers"));
394 break; 399 break;
395 case chrome::DIR_CHROMEOS_WALLPAPER_THUMBNAILS: 400 case chrome::DIR_CHROMEOS_WALLPAPER_THUMBNAILS:
396 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) 401 if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
397 return false; 402 return false;
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::FILE_DEFAULT_APP_ORDER: 405 case chrome::FILE_DEFAULT_APP_ORDER:
401 cur = base::FilePath(FILE_PATH_LITERAL(kDefaultAppOrderFileName)); 406 cur = base::FilePath(FILE_PATH_LITERAL(kDefaultAppOrderFileName));
Mattias Nissler (ping if slow) 2013/02/08 17:06:30 If you feel like cleaning up: FWIW, this is wrong
Joao da Silva 2013/02/13 16:22:05 Done in https://codereview.chromium.org/12230014/
402 break; 407 break;
408 case chrome::DIR_USER_POLICY_KEYS:
409 cur = FilePath(kDefaultUserPolicyKeysDir);
410 break;
403 #endif 411 #endif
404 // The following are only valid in the development environment, and 412 // The following are only valid in the development environment, and
405 // will fail if executed from an installed executable (because the 413 // will fail if executed from an installed executable (because the
406 // generated path won't exist). 414 // generated path won't exist).
407 case chrome::DIR_GEN_TEST_DATA: 415 case chrome::DIR_GEN_TEST_DATA:
408 if (!PathService::Get(base::DIR_MODULE, &cur)) 416 if (!PathService::Get(base::DIR_MODULE, &cur))
409 return false; 417 return false;
410 cur = cur.Append(FILE_PATH_LITERAL("test_data")); 418 cur = cur.Append(FILE_PATH_LITERAL("test_data"));
411 if (!file_util::PathExists(cur)) // We don't want to create this. 419 if (!file_util::PathExists(cur)) // We don't want to create this.
412 return false; 420 return false;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 return true; 516 return true;
509 } 517 }
510 518
511 // This cannot be done as a static initializer sadly since Visual Studio will 519 // This cannot be done as a static initializer sadly since Visual Studio will
512 // eliminate this object file if there is no direct entry point into it. 520 // eliminate this object file if there is no direct entry point into it.
513 void RegisterPathProvider() { 521 void RegisterPathProvider() {
514 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 522 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
515 } 523 }
516 524
517 } // namespace chrome 525 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698