| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 FlashComponentInstallerTraits::GetInstallerAttributes() const { | 260 FlashComponentInstallerTraits::GetInstallerAttributes() const { |
| 261 return update_client::InstallerAttributes(); | 261 return update_client::InstallerAttributes(); |
| 262 } | 262 } |
| 263 #endif // defined(GOOGLE_CHROME_BUILD) | 263 #endif // defined(GOOGLE_CHROME_BUILD) |
| 264 | 264 |
| 265 } // namespace | 265 } // namespace |
| 266 | 266 |
| 267 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { | 267 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { |
| 268 #if defined(GOOGLE_CHROME_BUILD) | 268 #if defined(GOOGLE_CHROME_BUILD) |
| 269 // Component updated flash supersedes bundled flash therefore if that one | 269 // Component updated flash supersedes bundled flash therefore if that one |
| 270 // is disabled then this one should never install. Similarly, if there is a | 270 // is disabled then this one should never install. |
| 271 // command-line specified Flash to use, do not replace it with a component | |
| 272 // version of Flash. | |
| 273 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 271 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
| 274 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash) | 272 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) |
| 275 || cmd_line->HasSwitch(switches::kPpapiFlashPath)) | |
| 276 return; | 273 return; |
| 277 std::unique_ptr<ComponentInstallerTraits> traits( | 274 std::unique_ptr<ComponentInstallerTraits> traits( |
| 278 new FlashComponentInstallerTraits); | 275 new FlashComponentInstallerTraits); |
| 279 // |cus| will take ownership of |installer| during installer->Register(cus). | 276 // |cus| will take ownership of |installer| during installer->Register(cus). |
| 280 DefaultComponentInstaller* installer = | 277 DefaultComponentInstaller* installer = |
| 281 new DefaultComponentInstaller(std::move(traits)); | 278 new DefaultComponentInstaller(std::move(traits)); |
| 282 installer->Register(cus, base::Closure()); | 279 installer->Register(cus, base::Closure()); |
| 283 #endif // defined(GOOGLE_CHROME_BUILD) | 280 #endif // defined(GOOGLE_CHROME_BUILD) |
| 284 } | 281 } |
| 285 | 282 |
| 286 } // namespace component_updater | 283 } // namespace component_updater |
| OLD | NEW |