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 808773005: Move most of the component updater artifacts to update_client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 <stdint.h> 5 #include <stdint.h>
6 #include <string.h> 6 #include <string.h>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 12 matching lines...) Expand all
23 #include "base/version.h" 23 #include "base/version.h"
24 #include "build/build_config.h" 24 #include "build/build_config.h"
25 #include "chrome/browser/component_updater/flash_component_installer.h" 25 #include "chrome/browser/component_updater/flash_component_installer.h"
26 #include "chrome/browser/component_updater/ppapi_utils.h" 26 #include "chrome/browser/component_updater/ppapi_utils.h"
27 #include "chrome/browser/plugins/plugin_prefs.h" 27 #include "chrome/browser/plugins/plugin_prefs.h"
28 #include "chrome/common/chrome_constants.h" 28 #include "chrome/common/chrome_constants.h"
29 #include "chrome/common/chrome_paths.h" 29 #include "chrome/common/chrome_paths.h"
30 #include "chrome/common/chrome_switches.h" 30 #include "chrome/common/chrome_switches.h"
31 #include "chrome/common/pepper_flash.h" 31 #include "chrome/common/pepper_flash.h"
32 #include "components/component_updater/component_updater_service.h" 32 #include "components/component_updater/component_updater_service.h"
33 #include "components/update_client/update_client.h"
33 #include "content/public/browser/browser_thread.h" 34 #include "content/public/browser/browser_thread.h"
34 #include "content/public/browser/plugin_service.h" 35 #include "content/public/browser/plugin_service.h"
35 #include "content/public/common/content_constants.h" 36 #include "content/public/common/content_constants.h"
36 #include "content/public/common/pepper_plugin_info.h" 37 #include "content/public/common/pepper_plugin_info.h"
37 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. NOLINT 38 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. NOLINT
38 #include "ppapi/c/private/ppb_pdf.h" 39 #include "ppapi/c/private/ppb_pdf.h"
39 #include "ppapi/shared_impl/ppapi_permissions.h" 40 #include "ppapi/shared_impl/ppapi_permissions.h"
40 41
41 using content::BrowserThread; 42 using content::BrowserThread;
42 using content::PluginService; 43 using content::PluginService;
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 return false; 324 return false;
324 if (!CheckPepperFlashInterfaceString(interface_string)) 325 if (!CheckPepperFlashInterfaceString(interface_string))
325 return false; 326 return false;
326 } 327 }
327 328
328 return true; 329 return true;
329 } 330 }
330 331
331 } // namespace 332 } // namespace
332 333
333 class PepperFlashComponentInstaller : public ComponentInstaller { 334 class PepperFlashComponentInstaller : public update_client::ComponentInstaller {
334 public: 335 public:
335 explicit PepperFlashComponentInstaller(const Version& version); 336 explicit PepperFlashComponentInstaller(const Version& version);
336 337
337 ~PepperFlashComponentInstaller() override {} 338 ~PepperFlashComponentInstaller() override {}
338 339
339 void OnUpdateError(int error) override; 340 void OnUpdateError(int error) override;
340 341
341 bool Install(const base::DictionaryValue& manifest, 342 bool Install(const base::DictionaryValue& manifest,
342 const base::FilePath& unpack_path) override; 343 const base::FilePath& unpack_path) override;
343 344
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 *version_out = version; 432 *version_out = version;
432 return true; 433 return true;
433 } 434 }
434 435
435 namespace { 436 namespace {
436 437
437 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) 438 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX)
438 void FinishPepperFlashUpdateRegistration(ComponentUpdateService* cus, 439 void FinishPepperFlashUpdateRegistration(ComponentUpdateService* cus,
439 const Version& version) { 440 const Version& version) {
440 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 441 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
441 CrxComponent pepflash; 442 update_client::CrxComponent pepflash;
442 pepflash.name = "pepper_flash"; 443 pepflash.name = "pepper_flash";
443 pepflash.installer = new PepperFlashComponentInstaller(version); 444 pepflash.installer = new PepperFlashComponentInstaller(version);
444 pepflash.version = version; 445 pepflash.version = version;
445 pepflash.pk_hash.assign(kSha2Hash, &kSha2Hash[sizeof(kSha2Hash)]); 446 pepflash.pk_hash.assign(kSha2Hash, &kSha2Hash[sizeof(kSha2Hash)]);
446 if (cus->RegisterComponent(pepflash) != ComponentUpdateService::kOk) { 447 if (cus->RegisterComponent(pepflash) != ComponentUpdateService::kOk) {
447 NOTREACHED() << "Pepper Flash component registration failed."; 448 NOTREACHED() << "Pepper Flash component registration failed.";
448 } 449 }
449 } 450 }
450 451
451 void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) { 452 void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); 508 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
508 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) 509 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash))
509 return; 510 return;
510 BrowserThread::PostTask(BrowserThread::FILE, 511 BrowserThread::PostTask(BrowserThread::FILE,
511 FROM_HERE, 512 FROM_HERE,
512 base::Bind(&StartPepperFlashUpdateRegistration, cus)); 513 base::Bind(&StartPepperFlashUpdateRegistration, cus));
513 #endif 514 #endif
514 } 515 }
515 516
516 } // namespace component_updater 517 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698