1 // Copyright 2016 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_EXTENSIONS_INSTALL_GATE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_GATE_H_ 7 8 namespace extensions { 9 10 class Extension; 11 12 // An interface that ExtensionService inquires for whether extension installs 13 // should be delayed and whether to finish/abort delayed installs. 14 class InstallGate { 15 public: 16 // Actions for a pending install. 17 enum Action { 18 INSTALL, // Proceed to finish the install. 19 DELAY, // Delay the install. 20 ABORT // Abort the install. 21 }; 22 23 virtual ~InstallGate() = default; 24 25 // Invoked by ExtensionService to check what to do with a pending install of 26 // the given extension. |extension| is an unpacked new extension to be 27 // installed. |install_immediately| is the flag associated with the install. 28 virtual Action ShouldDelay(const Extension* extension, 29 bool install_immediately) = 0; 30 }; 31 32 } // namespace extensions 33 34 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_GATE_H_ 35