@@ -72,7 +72,7 @@ ComponentConfig::ComponentConfig(const std::string& name,
72
72
: name(name), env_version(env_version), sha2hashstr(sha2hashstr) {}
73
73
ComponentConfig::~ComponentConfig () {}
74
74
75
- CrOSComponentInstallerTraits::CrOSComponentInstallerTraits (
75
+ CrOSComponentInstallerPolicy::CrOSComponentInstallerPolicy (
76
76
const ComponentConfig& config)
77
77
: name(config.name), env_version(config.env_version) {
78
78
if (config.sha2hashstr .length () != 64 )
@@ -84,17 +84,17 @@ CrOSComponentInstallerTraits::CrOSComponentInstallerTraits(
84
84
}
85
85
}
86
86
87
- bool CrOSComponentInstallerTraits ::SupportsGroupPolicyEnabledComponentUpdates ()
87
+ bool CrOSComponentInstallerPolicy ::SupportsGroupPolicyEnabledComponentUpdates ()
88
88
const {
89
89
return true ;
90
90
}
91
91
92
- bool CrOSComponentInstallerTraits ::RequiresNetworkEncryption () const {
92
+ bool CrOSComponentInstallerPolicy ::RequiresNetworkEncryption () const {
93
93
return true ;
94
94
}
95
95
96
96
update_client::CrxInstaller::Result
97
- CrOSComponentInstallerTraits ::OnCustomInstall (
97
+ CrOSComponentInstallerPolicy ::OnCustomInstall (
98
98
const base::DictionaryValue& manifest,
99
99
const base::FilePath& install_dir) {
100
100
std::string version;
@@ -107,7 +107,7 @@ CrOSComponentInstallerTraits::OnCustomInstall(
107
107
return update_client::CrxInstaller::Result (update_client::InstallError::NONE);
108
108
}
109
109
110
- void CrOSComponentInstallerTraits ::ComponentReady (
110
+ void CrOSComponentInstallerPolicy ::ComponentReady (
111
111
const base::Version& version,
112
112
const base::FilePath& path,
113
113
std::unique_ptr<base::DictionaryValue> manifest) {
@@ -119,37 +119,37 @@ void CrOSComponentInstallerTraits::ComponentReady(
119
119
}
120
120
}
121
121
122
- bool CrOSComponentInstallerTraits ::VerifyInstallation (
122
+ bool CrOSComponentInstallerPolicy ::VerifyInstallation (
123
123
const base::DictionaryValue& manifest,
124
124
const base::FilePath& install_dir) const {
125
125
return true ;
126
126
}
127
127
128
- base::FilePath CrOSComponentInstallerTraits ::GetRelativeInstallDir () const {
128
+ base::FilePath CrOSComponentInstallerPolicy ::GetRelativeInstallDir () const {
129
129
return base::FilePath (name);
130
130
}
131
131
132
- void CrOSComponentInstallerTraits ::GetHash (std::vector<uint8_t >* hash) const {
132
+ void CrOSComponentInstallerPolicy ::GetHash (std::vector<uint8_t >* hash) const {
133
133
hash->assign (kSha2Hash_ , kSha2Hash_ + arraysize (kSha2Hash_ ));
134
134
}
135
135
136
- std::string CrOSComponentInstallerTraits ::GetName () const {
136
+ std::string CrOSComponentInstallerPolicy ::GetName () const {
137
137
return name;
138
138
}
139
139
140
140
update_client::InstallerAttributes
141
- CrOSComponentInstallerTraits ::GetInstallerAttributes () const {
141
+ CrOSComponentInstallerPolicy ::GetInstallerAttributes () const {
142
142
update_client::InstallerAttributes attrs;
143
143
attrs[" _env_version" ] = env_version;
144
144
return attrs;
145
145
}
146
146
147
- std::vector<std::string> CrOSComponentInstallerTraits ::GetMimeTypes () const {
147
+ std::vector<std::string> CrOSComponentInstallerPolicy ::GetMimeTypes () const {
148
148
std::vector<std::string> mime_types;
149
149
return mime_types;
150
150
}
151
151
152
- bool CrOSComponentInstallerTraits ::IsCompatible (
152
+ bool CrOSComponentInstallerPolicy ::IsCompatible (
153
153
const std::string& env_version_str,
154
154
const std::string& min_env_version_str) {
155
155
base::Version env_version (env_version_str);
@@ -205,12 +205,11 @@ static void RegisterComponent(ComponentUpdateService* cus,
205
205
const ComponentConfig& config,
206
206
const base::Closure& register_callback) {
207
207
DCHECK_CURRENTLY_ON (content::BrowserThread::UI);
208
- std::unique_ptr<ComponentInstallerTraits> traits (
209
- new CrOSComponentInstallerTraits (config));
208
+ std::unique_ptr<ComponentInstallerPolicy> policy (
209
+ new CrOSComponentInstallerPolicy (config));
210
210
// |cus| will take ownership of |installer| during
211
211
// installer->Register(cus).
212
- DefaultComponentInstaller* installer =
213
- new DefaultComponentInstaller (std::move (traits));
212
+ ComponentInstaller* installer = new ComponentInstaller (std::move (policy));
214
213
installer->Register (cus, register_callback);
215
214
}
216
215
0 commit comments