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

Side by Side Diff: chromeos/chromeos_paths.cc

Issue 258743005: Enable Enterprise enrollment on desktop builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added arg to PathService::OverrideAndCreateIfNeeded, added test for FakeCryptohomeClient::InstallAt… Created 6 years, 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chromeos/chromeos_paths.h" 5 #include "chromeos/chromeos_paths.h"
6 6
7 #include "base/file_util.h"
7 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
8 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/sys_info.h"
9 11
10 namespace chromeos { 12 namespace chromeos {
11 13
12 namespace { 14 namespace {
13 15
14 const base::FilePath::CharType kDefaultAppOrderFileName[] = 16 const base::FilePath::CharType kDefaultAppOrderFileName[] =
15 #if defined(GOOGLE_CHROME_BUILD) 17 #if defined(GOOGLE_CHROME_BUILD)
16 FILE_PATH_LITERAL("/usr/share/google-chrome/default_app_order.json"); 18 FILE_PATH_LITERAL("/usr/share/google-chrome/default_app_order.json");
17 #else 19 #else
18 FILE_PATH_LITERAL("/usr/share/chromium/default_app_order.json"); 20 FILE_PATH_LITERAL("/usr/share/chromium/default_app_order.json");
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 72 }
71 return true; 73 return true;
72 } 74 }
73 75
74 } // namespace 76 } // namespace
75 77
76 void RegisterPathProvider() { 78 void RegisterPathProvider() {
77 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 79 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
78 } 80 }
79 81
82 void RegisterStubPathOverrides(const base::FilePath& stubs_dir) {
83 CHECK(!base::SysInfo::IsRunningOnChromeOS());
84 // Override these paths on the desktop, so that enrollment and cloud
85 // policy work and can be tested.
86 base::FilePath parent = base::MakeAbsoluteFilePath(stubs_dir);
87 PathService::Override(
88 DIR_USER_POLICY_KEYS,
89 parent.AppendASCII("stub_user_policy"));
90 const bool is_absolute = true;
91 const bool create = false;
92 PathService::OverrideAndCreateIfNeeded(
93 FILE_OWNER_KEY,
94 parent.AppendASCII("stub_owner.key"),
95 is_absolute,
96 create);
97 PathService::OverrideAndCreateIfNeeded(
98 FILE_INSTALL_ATTRIBUTES,
99 parent.AppendASCII("stub_install_attributes.pb"),
100 is_absolute,
101 create);
102 }
103
80 } // namespace chromeos 104 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698