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

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

Issue 2711593006: Report built_in_version to Omaha for Flash updates. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 void FlashComponentInstallerTraits::GetHash(std::vector<uint8_t>* hash) const { 334 void FlashComponentInstallerTraits::GetHash(std::vector<uint8_t>* hash) const {
335 hash->assign(kSha2Hash, kSha2Hash + arraysize(kSha2Hash)); 335 hash->assign(kSha2Hash, kSha2Hash + arraysize(kSha2Hash));
336 } 336 }
337 337
338 std::string FlashComponentInstallerTraits::GetName() const { 338 std::string FlashComponentInstallerTraits::GetName() const {
339 return "Adobe Flash Player"; 339 return "Adobe Flash Player";
340 } 340 }
341 341
342 update_client::InstallerAttributes 342 update_client::InstallerAttributes
343 FlashComponentInstallerTraits::GetInstallerAttributes() const { 343 FlashComponentInstallerTraits::GetInstallerAttributes() const {
344 return update_client::InstallerAttributes(); 344 // For Chrome OS, send the built-in flash player version to the server,
345 // otherwise it will serve component updates of outdated flash players.
346 update_client::InstallerAttributes attrs =
347 update_client::InstallerAttributes();
348 #if defined(OS_CHROMEOS)
349 std::string flash_version =
350 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
351 switches::kPpapiFlashVersion);
352 bool did_insert =
353 attrs.insert(std::make_pair("built_in_version", flash_version)).second;
waffles 2017/02/24 18:35:51 Will this generated an unused variable warning in
Greg K 2017/02/24 19:03:59 That's a fair point, let's do the DCHECK() directl
354 DCHECK(did_insert);
355 #endif // #defined(OS_CHROMEOS)
356 return attrs;
345 } 357 }
346 358
347 std::vector<std::string> FlashComponentInstallerTraits::GetMimeTypes() const { 359 std::vector<std::string> FlashComponentInstallerTraits::GetMimeTypes() const {
348 std::vector<std::string> mime_types; 360 std::vector<std::string> mime_types;
349 mime_types.push_back("application/x-shockwave-flash"); 361 mime_types.push_back("application/x-shockwave-flash");
350 mime_types.push_back("application/futuresplash"); 362 mime_types.push_back("application/futuresplash");
351 return mime_types; 363 return mime_types;
352 } 364 }
353 #endif // defined(GOOGLE_CHROME_BUILD) 365 #endif // defined(GOOGLE_CHROME_BUILD)
354 366
(...skipping 15 matching lines...) Expand all
370 std::unique_ptr<ComponentInstallerTraits> traits( 382 std::unique_ptr<ComponentInstallerTraits> traits(
371 new FlashComponentInstallerTraits); 383 new FlashComponentInstallerTraits);
372 // |cus| will take ownership of |installer| during installer->Register(cus). 384 // |cus| will take ownership of |installer| during installer->Register(cus).
373 DefaultComponentInstaller* installer = 385 DefaultComponentInstaller* installer =
374 new DefaultComponentInstaller(std::move(traits)); 386 new DefaultComponentInstaller(std::move(traits));
375 installer->Register(cus, base::Closure()); 387 installer->Register(cus, base::Closure());
376 #endif // defined(GOOGLE_CHROME_BUILD) 388 #endif // defined(GOOGLE_CHROME_BUILD)
377 } 389 }
378 390
379 } // namespace component_updater 391 } // namespace component_updater
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698