OLD | NEW |
---|---|
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_EXTENSIONS_EXTERNAL_PREF_LOADER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_LOADER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_LOADER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_LOADER_H_ |
7 | 7 |
8 #include "chrome/browser/extensions/external_loader.h" | 8 #include "chrome/browser/extensions/external_loader.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 | 15 |
16 namespace extensions { | 16 namespace extensions { |
17 | 17 |
18 // A specialization of the ExternalLoader that uses a json file to | 18 // A specialization of the ExternalLoader that uses a json file to |
19 // look up which external extensions are registered. | 19 // look up which external extensions are registered. |
20 // Instances of this class are expected to be created and destroyed on the UI | 20 // Instances of this class are expected to be created and destroyed on the UI |
21 // thread and they are expecting public method calls from the UI thread. | 21 // thread and they are expecting public method calls from the UI thread. |
22 class ExternalPrefLoader : public ExternalLoader { | 22 class ExternalPrefLoader : public ExternalLoader { |
23 public: | 23 public: |
24 enum Options { | 24 enum Options { |
25 NONE = 0, | 25 NONE = 0, |
26 | 26 |
27 // Ensure that only root can force an external install by checking | 27 // Ensure that only root can force an external install by checking |
28 // that all components of the path to external extensions files are | 28 // that all components of the path to external extensions files are |
29 // owned by root and not writable by any non-root user. | 29 // owned by root and not writable by any non-root user. |
30 ENSURE_PATH_CONTROLLED_BY_ADMIN = 1 << 0 | 30 ENSURE_PATH_CONTROLLED_BY_ADMIN = 1 << 0, |
31 | |
32 // Delay external preference load. It delays default apps installation | |
33 // to don't overload system on first time user login. | |
asargent_no_longer_on_chrome
2014/10/23 22:34:35
grammar nit: should be "... to not overload the sy
Dmitry Polukhin
2014/10/24 11:40:42
Done.
| |
34 DELAY_LOAD = 1 << 1, | |
31 }; | 35 }; |
32 | 36 |
33 // |base_path_id| is the directory containing the external_extensions.json | 37 // |base_path_id| is the directory containing the external_extensions.json |
34 // file or the standalone extension manifest files. Relative file paths to | 38 // file or the standalone extension manifest files. Relative file paths to |
35 // extension files are resolved relative to this path. | 39 // extension files are resolved relative to this path. |
36 ExternalPrefLoader(int base_path_id, Options options); | 40 ExternalPrefLoader(int base_path_id, Options options); |
37 | 41 |
38 const base::FilePath GetBaseCrxFilePath() override; | 42 const base::FilePath GetBaseCrxFilePath() override; |
39 | 43 |
40 protected: | 44 protected: |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 | 102 |
99 base::FilePath fake_base_path_; | 103 base::FilePath fake_base_path_; |
100 scoped_ptr<base::DictionaryValue> testing_prefs_; | 104 scoped_ptr<base::DictionaryValue> testing_prefs_; |
101 | 105 |
102 DISALLOW_COPY_AND_ASSIGN(ExternalTestingLoader); | 106 DISALLOW_COPY_AND_ASSIGN(ExternalTestingLoader); |
103 }; | 107 }; |
104 | 108 |
105 } // namespace extensions | 109 } // namespace extensions |
106 | 110 |
107 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_LOADER_H_ | 111 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_LOADER_H_ |
OLD | NEW |