Index: chrome/browser/extensions/crx_installer.h |
diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h |
index ce9b8e6a8a47aa255877ed7460116bd7ef552e89..7613d93fdaeb7d20a7a5ae6065790f98c736ba52 100644 |
--- a/chrome/browser/extensions/crx_installer.h |
+++ b/chrome/browser/extensions/crx_installer.h |
@@ -44,6 +44,18 @@ class CrxInstaller |
: public SandboxedExtensionUnpackerClient, |
public ExtensionInstallUI::Delegate { |
public: |
+ |
+ // This is pretty lame, but given the difficulty of connecting a particular |
+ // ExtensionFunction to a resulting download in the download manager, it's |
+ // currently necessary. This is the |id| of an extension to be installed |
+ // *by the web store only* which should not get the permissions install |
+ // prompt. |
+ // crbug.com/54916 |
+ static void SetWhitelistedInstallId(const std::string& id); |
+ |
+ // Returns whether |id| was found and removed (was whitelisted). |
+ static bool ClearWhitelistedInstallId(const std::string& id); |
+ |
// Constructor. Extensions will be unpacked to |install_directory|. |
// Extension objects will be sent to |frontend|, and any UI will be shown |
// via |client|. For silent install, pass NULL for |client|. |
@@ -83,6 +95,9 @@ class CrxInstaller |
allow_privilege_increase_ = val; |
} |
+ bool allow_silent_install() const { return allow_silent_install_; } |
+ void set_allow_silent_install(bool val) { allow_silent_install_ = val; } |
+ |
bool limit_web_extent_to_download_host() const { |
return limit_web_extent_to_download_host_; |
} |
@@ -203,6 +218,13 @@ class CrxInstaller |
// Used to trigger extra checks before installing. |
bool apps_require_extension_mime_type_; |
+ // Allows for the possibility of a normal install (one in which a |client| |
+ // is provided in the ctor) to procede without showing the permissions prompt |
+ // dialog. Note that this will only take place if |allow_silent_install_| |
+ // is true AND the unpacked id of the extension is whitelisted with |
+ // SetWhitelistedInstallId(). |
+ bool allow_silent_install_; |
+ |
// The value of the content type header sent with the CRX. |
// Ignorred unless |require_extension_mime_type_| is true. |
std::string original_mime_type_; |