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. | 270 // is disabled then this one should never install. Similarly, if there is a |
| 271 // command-line specified Flash to use, do not replace it with a component |
| 272 // version of Flash. |
271 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 273 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
272 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) | 274 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash) |
| 275 || cmd_line->HasSwitch(switches::kPpapiFlashPath)) |
273 return; | 276 return; |
274 std::unique_ptr<ComponentInstallerTraits> traits( | 277 std::unique_ptr<ComponentInstallerTraits> traits( |
275 new FlashComponentInstallerTraits); | 278 new FlashComponentInstallerTraits); |
276 // |cus| will take ownership of |installer| during installer->Register(cus). | 279 // |cus| will take ownership of |installer| during installer->Register(cus). |
277 DefaultComponentInstaller* installer = | 280 DefaultComponentInstaller* installer = |
278 new DefaultComponentInstaller(std::move(traits)); | 281 new DefaultComponentInstaller(std::move(traits)); |
279 installer->Register(cus, base::Closure()); | 282 installer->Register(cus, base::Closure()); |
280 #endif // defined(GOOGLE_CHROME_BUILD) | 283 #endif // defined(GOOGLE_CHROME_BUILD) |
281 } | 284 } |
282 | 285 |
283 } // namespace component_updater | 286 } // namespace component_updater |
OLD | NEW |