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

Side by Side Diff: chrome/browser/component_updater/pepper_flash_component_installer.cc

Issue 2102083002: Allow component installers to specify a map of installer attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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) 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 "chrome/browser/component_updater/pepper_flash_component_installer.h" 5 #include "chrome/browser/component_updater/pepper_flash_component_installer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 bool OnCustomInstall(const base::DictionaryValue& manifest, 177 bool OnCustomInstall(const base::DictionaryValue& manifest,
178 const base::FilePath& install_dir) override; 178 const base::FilePath& install_dir) override;
179 bool VerifyInstallation(const base::DictionaryValue& manifest, 179 bool VerifyInstallation(const base::DictionaryValue& manifest,
180 const base::FilePath& install_dir) const override; 180 const base::FilePath& install_dir) const override;
181 void ComponentReady(const base::Version& version, 181 void ComponentReady(const base::Version& version,
182 const base::FilePath& path, 182 const base::FilePath& path,
183 std::unique_ptr<base::DictionaryValue> manifest) override; 183 std::unique_ptr<base::DictionaryValue> manifest) override;
184 base::FilePath GetRelativeInstallDir() const override; 184 base::FilePath GetRelativeInstallDir() const override;
185 void GetHash(std::vector<uint8_t>* hash) const override; 185 void GetHash(std::vector<uint8_t>* hash) const override;
186 std::string GetName() const override; 186 std::string GetName() const override;
187 std::string GetAp() const override; 187 update_client::InstallerAttributes GetInstallerAttributes() const override;
188 188
189 DISALLOW_COPY_AND_ASSIGN(FlashComponentInstallerTraits); 189 DISALLOW_COPY_AND_ASSIGN(FlashComponentInstallerTraits);
190 }; 190 };
191 191
192 FlashComponentInstallerTraits::FlashComponentInstallerTraits() {} 192 FlashComponentInstallerTraits::FlashComponentInstallerTraits() {}
193 193
194 bool FlashComponentInstallerTraits::CanAutoUpdate() const { 194 bool FlashComponentInstallerTraits::CanAutoUpdate() const {
195 return true; 195 return true;
196 } 196 }
197 197
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 } 246 }
247 247
248 void FlashComponentInstallerTraits::GetHash(std::vector<uint8_t>* hash) const { 248 void FlashComponentInstallerTraits::GetHash(std::vector<uint8_t>* hash) const {
249 hash->assign(kSha2Hash, kSha2Hash + arraysize(kSha2Hash)); 249 hash->assign(kSha2Hash, kSha2Hash + arraysize(kSha2Hash));
250 } 250 }
251 251
252 std::string FlashComponentInstallerTraits::GetName() const { 252 std::string FlashComponentInstallerTraits::GetName() const {
253 return "pepper_flash"; 253 return "pepper_flash";
254 } 254 }
255 255
256 std::string FlashComponentInstallerTraits::GetAp() const { 256 update_client::InstallerAttributes
257 return std::string(); 257 FlashComponentInstallerTraits::GetInstallerAttributes() const {
258 return update_client::InstallerAttributes();
258 } 259 }
259 #endif // defined(GOOGLE_CHROME_BUILD) 260 #endif // defined(GOOGLE_CHROME_BUILD)
260 261
261 } // namespace 262 } // namespace
262 263
263 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { 264 void RegisterPepperFlashComponent(ComponentUpdateService* cus) {
264 #if defined(GOOGLE_CHROME_BUILD) 265 #if defined(GOOGLE_CHROME_BUILD)
265 // Component updated flash supersedes bundled flash therefore if that one 266 // Component updated flash supersedes bundled flash therefore if that one
266 // is disabled then this one should never install. 267 // is disabled then this one should never install.
267 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); 268 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
268 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) 269 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash))
269 return; 270 return;
270 std::unique_ptr<ComponentInstallerTraits> traits( 271 std::unique_ptr<ComponentInstallerTraits> traits(
271 new FlashComponentInstallerTraits); 272 new FlashComponentInstallerTraits);
272 // |cus| will take ownership of |installer| during installer->Register(cus). 273 // |cus| will take ownership of |installer| during installer->Register(cus).
273 DefaultComponentInstaller* installer = 274 DefaultComponentInstaller* installer =
274 new DefaultComponentInstaller(std::move(traits)); 275 new DefaultComponentInstaller(std::move(traits));
275 installer->Register(cus, base::Closure()); 276 installer->Register(cus, base::Closure());
276 #endif // defined(GOOGLE_CHROME_BUILD) 277 #endif // defined(GOOGLE_CHROME_BUILD)
277 } 278 }
278 279
279 } // namespace component_updater 280 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698