OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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_MANAGED_MODE_SCOPED_EXTENSION_ELEVATION_H_ |
| 6 #define CHROME_BROWSER_MANAGED_MODE_SCOPED_EXTENSION_ELEVATION_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 |
| 13 class ManagedUserService; |
| 14 |
| 15 // Used to allow managed users to install extensions if they are currently in |
| 16 // elevated state. |
| 17 class ScopedExtensionElevation { |
| 18 public: |
| 19 explicit ScopedExtensionElevation(ManagedUserService* service); |
| 20 ~ScopedExtensionElevation(); |
| 21 |
| 22 // Add elevation for the extension with the id |extension_id|. |
| 23 void AddExtension(const std::string& extension_id); |
| 24 |
| 25 private: |
| 26 ManagedUserService* service_; |
| 27 |
| 28 // A list of extensions which stay elevated until the destructor of this |
| 29 // class is called. |
| 30 std::vector<std::string> elevated_extensions_; |
| 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(ScopedExtensionElevation); |
| 33 }; |
| 34 |
| 35 #endif // CHROME_BROWSER_MANAGED_MODE_SCOPED_EXTENSION_ELEVATION_H_ |
OLD | NEW |