16e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 26e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 36e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// found in the LICENSE file. 46e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 56e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#ifndef CHROME_BROWSER_COMPONENT_UPDATER_EV_WHITELIST_COMPONENT_INSTALLER_H_ 66e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#define CHROME_BROWSER_COMPONENT_UPDATER_EV_WHITELIST_COMPONENT_INSTALLER_H_ 76e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 81320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include <stdint.h> 96e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include <string> 106e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include <vector> 116e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 126e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include "base/files/file_path.h" 131320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "base/macros.h" 146e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include "base/values.h" 1503b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)#include "components/component_updater/default_component_installer.h" 166e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 176e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)namespace component_updater { 186e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 196e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)class ComponentUpdateService; 206e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 216e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)class EVWhitelistComponentInstallerTraits : public ComponentInstallerTraits { 226e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) public: 236e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) EVWhitelistComponentInstallerTraits(); 246e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) virtual ~EVWhitelistComponentInstallerTraits() {} 256e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 266e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) private: 276e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) // The following methods override ComponentInstallerTraits. 286e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) virtual bool CanAutoUpdate() const OVERRIDE; 296e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) virtual bool OnCustomInstall(const base::DictionaryValue& manifest, 306e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) const base::FilePath& install_dir) OVERRIDE; 316e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) virtual bool VerifyInstallation( 326e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) const base::FilePath& install_dir) const OVERRIDE; 336e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) virtual void ComponentReady( 346e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) const base::Version& version, 356e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) const base::FilePath& path, 366e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) scoped_ptr<base::DictionaryValue> manifest) OVERRIDE; 376e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) virtual base::FilePath GetBaseDirectory() const OVERRIDE; 381320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci virtual void GetHash(std::vector<uint8_t>* hash) const OVERRIDE; 396e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) virtual std::string GetName() const OVERRIDE; 406e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 416e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) static base::FilePath GetInstalledPath(const base::FilePath& base); 426e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 436e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(EVWhitelistComponentInstallerTraits); 446e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)}; 456e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 466e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// Call once during startup to make the component update service aware of 476e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// the EV whitelist. 486e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)void RegisterEVWhitelistComponent(ComponentUpdateService* cus); 496e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 506e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)} // namespace component_updater 516e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 526e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#endif // CHROME_BROWSER_COMPONENT_UPDATER_EV_WHITELIST_COMPONENT_INSTALLER_H_ 53