ev_whitelist_component_installer.h revision 6e8cce623b6e4fe0c9e4af605d675dd9d0338c38
1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_COMPONENT_UPDATER_EV_WHITELIST_COMPONENT_INSTALLER_H_
6#define CHROME_BROWSER_COMPONENT_UPDATER_EV_WHITELIST_COMPONENT_INSTALLER_H_
7
8#include <string>
9#include <vector>
10
11#include "base/files/file_path.h"
12#include "base/values.h"
13#include "chrome/browser/component_updater/default_component_installer.h"
14
15namespace component_updater {
16
17class ComponentUpdateService;
18
19class EVWhitelistComponentInstallerTraits : public ComponentInstallerTraits {
20 public:
21  EVWhitelistComponentInstallerTraits();
22  virtual ~EVWhitelistComponentInstallerTraits() {}
23
24 private:
25  // The following methods override ComponentInstallerTraits.
26  virtual bool CanAutoUpdate() const OVERRIDE;
27  virtual bool OnCustomInstall(const base::DictionaryValue& manifest,
28                               const base::FilePath& install_dir) OVERRIDE;
29  virtual bool VerifyInstallation(
30      const base::FilePath& install_dir) const OVERRIDE;
31  virtual void ComponentReady(
32      const base::Version& version,
33      const base::FilePath& path,
34      scoped_ptr<base::DictionaryValue> manifest) OVERRIDE;
35  virtual base::FilePath GetBaseDirectory() const OVERRIDE;
36  virtual void GetHash(std::vector<uint8>* hash) const OVERRIDE;
37  virtual std::string GetName() const OVERRIDE;
38
39  static base::FilePath GetInstalledPath(const base::FilePath& base);
40
41  DISALLOW_COPY_AND_ASSIGN(EVWhitelistComponentInstallerTraits);
42};
43
44// Call once during startup to make the component update service aware of
45// the EV whitelist.
46void RegisterEVWhitelistComponent(ComponentUpdateService* cus);
47
48}  // namespace component_updater
49
50#endif  // CHROME_BROWSER_COMPONENT_UPDATER_EV_WHITELIST_COMPONENT_INSTALLER_H_
51