diff options
author | ginkage <ginkage@chromium.org> | 2015-02-27 00:42:41 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-27 08:43:23 +0000 |
commit | 47e603edc7bf06b34271d324dcbd327153030445 (patch) | |
tree | b2e52acf1d5bb89d8d1a4ccb72fcae75b7118531 /extensions/browser/install | |
parent | dd5de986839a9f12fa09c0a0e7c8023fb8c29626 (diff) | |
download | chromium_src-47e603edc7bf06b34271d324dcbd327153030445.zip chromium_src-47e603edc7bf06b34271d324dcbd327153030445.tar.gz chromium_src-47e603edc7bf06b34271d324dcbd327153030445.tar.bz2 |
Implement ID/Hash-based extension cache map.
BUG=447077
TBR=benjhayden,pkasting
Review URL: https://codereview.chromium.org/901413003
Cr-Commit-Position: refs/heads/master@{#318418}
Diffstat (limited to 'extensions/browser/install')
-rw-r--r-- | extensions/browser/install/crx_install_error.h (renamed from extensions/browser/install/crx_installer_error.h) | 28 | ||||
-rw-r--r-- | extensions/browser/install/extension_install_ui.h | 4 |
2 files changed, 20 insertions, 12 deletions
diff --git a/extensions/browser/install/crx_installer_error.h b/extensions/browser/install/crx_install_error.h index 47d0932..af25df6 100644 --- a/extensions/browser/install/crx_installer_error.h +++ b/extensions/browser/install/crx_install_error.h @@ -2,29 +2,37 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef EXTENSIONS_BROWSER_INSTALL_CRX_INSTALLER_ERROR_H_ -#define EXTENSIONS_BROWSER_INSTALL_CRX_INSTALLER_ERROR_H_ +#ifndef EXTENSIONS_BROWSER_INSTALL_CRX_INSTALL_ERROR_H_ +#define EXTENSIONS_BROWSER_INSTALL_CRX_INSTALL_ERROR_H_ #include "base/strings/string16.h" namespace extensions { // Simple error class for CrxInstaller. -class CrxInstallerError { +class CrxInstallError { public: // Typed errors that need to be handled specially by clients. // ERROR_OFF_STORE for disallowed off-store installations. // ERROR_DECLINED for situations when a .crx file seems to be OK, but there // are some policy restrictions or unmet dependencies that prevent it from // being installed. - enum Type { ERROR_NONE, ERROR_OFF_STORE, ERROR_DECLINED, ERROR_OTHER }; - - CrxInstallerError() : type_(ERROR_NONE) {} - - explicit CrxInstallerError(const base::string16& message) + // ERROR_HASH_MISMATCH if the expected extension SHA256 hash sum is different + // from the actual one. + enum Type { + ERROR_NONE, + ERROR_OFF_STORE, + ERROR_DECLINED, + ERROR_HASH_MISMATCH, + ERROR_OTHER + }; + + CrxInstallError() : type_(ERROR_NONE) {} + + explicit CrxInstallError(const base::string16& message) : type_(message.empty() ? ERROR_NONE : ERROR_OTHER), message_(message) {} - CrxInstallerError(Type type, const base::string16& message) + CrxInstallError(Type type, const base::string16& message) : type_(type), message_(message) {} Type type() const { return type_; } @@ -37,4 +45,4 @@ class CrxInstallerError { } // namespace extensions -#endif // EXTENSIONS_BROWSER_INSTALL_CRX_INSTALLER_ERROR_H_ +#endif // EXTENSIONS_BROWSER_INSTALL_CRX_INSTALL_ERROR_H_ diff --git a/extensions/browser/install/extension_install_ui.h b/extensions/browser/install/extension_install_ui.h index f9cbe4b..0948f00d 100644 --- a/extensions/browser/install/extension_install_ui.h +++ b/extensions/browser/install/extension_install_ui.h @@ -13,7 +13,7 @@ class SkBitmap; namespace extensions { -class CrxInstallerError; +class CrxInstallError; class Extension; // Interface that should be implemented for each platform to display all the UI @@ -28,7 +28,7 @@ class ExtensionInstallUI { const SkBitmap* icon) = 0; // Called when an extension failed to install. - virtual void OnInstallFailure(const extensions::CrxInstallerError& error) = 0; + virtual void OnInstallFailure(const extensions::CrxInstallError& error) = 0; // TODO(asargent) Normally we navigate to the new tab page when an app is // installed, but we're experimenting with instead showing a bubble when |