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

Side by Side Diff: chrome/browser/policy/policy_path_parser.h

Issue 214233003: Refactorise the policy_path_parser framework (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes the review comments Created 6 years, 8 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
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 #ifndef CHROME_BROWSER_POLICY_POLICY_PATH_PARSER_H_ 5 #ifndef CHROME_BROWSER_POLICY_POLICY_PATH_PARSER_H_
6 #define CHROME_BROWSER_POLICY_POLICY_PATH_PARSER_H_ 6 #define CHROME_BROWSER_POLICY_POLICY_PATH_PARSER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h"
10 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
11 12
12 namespace policy { 13 namespace policy {
13 14
14 namespace path_parser { 15 namespace path_parser {
15 16
17 namespace internal {
18
19 typedef bool (*GetValueFuncPtr)(base::FilePath::StringType*);
20
21 struct VariableNameAndValueCallback {
22 const base::FilePath::CharType* name;
23 const GetValueFuncPtr value_func_ptr;
24 };
25
26 // Different set of variables are supported in each platform (see below). Hence
27 // this table is filled in with different elements in each platform.
28 extern const VariableNameAndValueCallback kVariableNameAndValueCallbacks[];
29
30 // Since the number of elements in the table could vary for each platform, this
31 // variable is used to keep track of it.
32 extern const int kNoOfVariables;
33 }
34
16 // This function is used to expand the variables in policy strings that 35 // This function is used to expand the variables in policy strings that
17 // represent paths. The set of supported variables differs between platforms 36 // represent paths. The set of supported variables differs between platforms
18 // but generally covers most standard locations that might be needed in the 37 // but generally covers most standard locations that might be needed in the
19 // existing used cases. 38 // existing used cases.
20 // All platforms: 39 // All platforms:
21 // ${user_name} - The user that is running Chrome (respects suids). 40 // ${user_name} - The user that is running Chrome (respects suids).
22 // (example : "johndoe") 41 // (example : "johndoe")
23 // ${machine_name} - The machine name possibly with domain (example : 42 // ${machine_name} - The machine name possibly with domain (example :
24 // "johnny.cg1.cooldomain.org") 43 // "johnny.cg1.cooldomain.org")
25 // Windows only: 44 // Windows only:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // this function should be used to verify no policy is specified whenever the 77 // this function should be used to verify no policy is specified whenever the
59 // profile path is not read from the PathService which already takes this into 78 // profile path is not read from the PathService which already takes this into
60 // account. 79 // account.
61 void CheckUserDataDirPolicy(base::FilePath* user_data_dir); 80 void CheckUserDataDirPolicy(base::FilePath* user_data_dir);
62 81
63 } // namespace path_parser 82 } // namespace path_parser
64 83
65 } // namespace policy 84 } // namespace policy
66 85
67 #endif // CHROME_BROWSER_POLICY_POLICY_PATH_PARSER_H_ 86 #endif // CHROME_BROWSER_POLICY_POLICY_PATH_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/policy_path_parser.cc » ('j') | chrome/browser/policy/policy_path_parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698