| OLD | NEW |
| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 const base::FilePath& install_dir) override; | 180 const base::FilePath& install_dir) override; |
| 181 bool VerifyInstallation(const base::DictionaryValue& manifest, | 181 bool VerifyInstallation(const base::DictionaryValue& manifest, |
| 182 const base::FilePath& install_dir) const override; | 182 const base::FilePath& install_dir) const override; |
| 183 void ComponentReady(const base::Version& version, | 183 void ComponentReady(const base::Version& version, |
| 184 const base::FilePath& path, | 184 const base::FilePath& path, |
| 185 std::unique_ptr<base::DictionaryValue> manifest) override; | 185 std::unique_ptr<base::DictionaryValue> manifest) override; |
| 186 base::FilePath GetRelativeInstallDir() const override; | 186 base::FilePath GetRelativeInstallDir() const override; |
| 187 void GetHash(std::vector<uint8_t>* hash) const override; | 187 void GetHash(std::vector<uint8_t>* hash) const override; |
| 188 std::string GetName() const override; | 188 std::string GetName() const override; |
| 189 update_client::InstallerAttributes GetInstallerAttributes() const override; | 189 update_client::InstallerAttributes GetInstallerAttributes() const override; |
| 190 void AddMimeTypes(std::vector<std::string>* mime_types) const override; |
| 190 | 191 |
| 191 DISALLOW_COPY_AND_ASSIGN(FlashComponentInstallerTraits); | 192 DISALLOW_COPY_AND_ASSIGN(FlashComponentInstallerTraits); |
| 192 }; | 193 }; |
| 193 | 194 |
| 194 FlashComponentInstallerTraits::FlashComponentInstallerTraits() {} | 195 FlashComponentInstallerTraits::FlashComponentInstallerTraits() {} |
| 195 | 196 |
| 196 bool FlashComponentInstallerTraits::CanAutoUpdate() const { | 197 bool FlashComponentInstallerTraits::CanAutoUpdate() const { |
| 197 return true; | 198 return true; |
| 198 } | 199 } |
| 199 | 200 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 } | 254 } |
| 254 | 255 |
| 255 std::string FlashComponentInstallerTraits::GetName() const { | 256 std::string FlashComponentInstallerTraits::GetName() const { |
| 256 return "pepper_flash"; | 257 return "pepper_flash"; |
| 257 } | 258 } |
| 258 | 259 |
| 259 update_client::InstallerAttributes | 260 update_client::InstallerAttributes |
| 260 FlashComponentInstallerTraits::GetInstallerAttributes() const { | 261 FlashComponentInstallerTraits::GetInstallerAttributes() const { |
| 261 return update_client::InstallerAttributes(); | 262 return update_client::InstallerAttributes(); |
| 262 } | 263 } |
| 264 |
| 265 void FlashComponentInstallerTraits::AddMimeTypes( |
| 266 std::vector<std::string>* mime_types) const { |
| 267 mime_types->push_back("application/x-shockwave-flash"); |
| 268 mime_types->push_back("application/futuresplash"); |
| 269 } |
| 263 #endif // defined(GOOGLE_CHROME_BUILD) | 270 #endif // defined(GOOGLE_CHROME_BUILD) |
| 264 | 271 |
| 265 } // namespace | 272 } // namespace |
| 266 | 273 |
| 267 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { | 274 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { |
| 268 #if defined(GOOGLE_CHROME_BUILD) | 275 #if defined(GOOGLE_CHROME_BUILD) |
| 269 // Component updated flash supersedes bundled flash therefore if that one | 276 // Component updated flash supersedes bundled flash therefore if that one |
| 270 // is disabled then this one should never install. | 277 // is disabled then this one should never install. |
| 271 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 278 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
| 272 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) | 279 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) |
| 273 return; | 280 return; |
| 274 std::unique_ptr<ComponentInstallerTraits> traits( | 281 std::unique_ptr<ComponentInstallerTraits> traits( |
| 275 new FlashComponentInstallerTraits); | 282 new FlashComponentInstallerTraits); |
| 276 // |cus| will take ownership of |installer| during installer->Register(cus). | 283 // |cus| will take ownership of |installer| during installer->Register(cus). |
| 277 DefaultComponentInstaller* installer = | 284 DefaultComponentInstaller* installer = |
| 278 new DefaultComponentInstaller(std::move(traits)); | 285 new DefaultComponentInstaller(std::move(traits)); |
| 279 installer->Register(cus, base::Closure()); | 286 installer->Register(cus, base::Closure()); |
| 280 #endif // defined(GOOGLE_CHROME_BUILD) | 287 #endif // defined(GOOGLE_CHROME_BUILD) |
| 281 } | 288 } |
| 282 | 289 |
| 283 } // namespace component_updater | 290 } // namespace component_updater |
| OLD | NEW |