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 #include "chrome/browser/managed_mode/scoped_extension_elevation.h" |
| 6 |
| 7 #include "chrome/browser/managed_mode/managed_user_service.h" |
| 8 |
| 9 ScopedExtensionElevation::ScopedExtensionElevation(ManagedUserService* service) |
| 10 : service_(service) { |
| 11 } |
| 12 |
| 13 void ScopedExtensionElevation::AddExtension(const std::string& extension_id) { |
| 14 service_->AddElevationForExtension(extension_id); |
| 15 elevated_extensions_.push_back(extension_id); |
| 16 } |
| 17 |
| 18 ScopedExtensionElevation::~ScopedExtensionElevation() { |
| 19 for (size_t i = 0; i < elevated_extensions_.size(); ++i) |
| 20 service_->RemoveElevationForExtension(elevated_extensions_[i]); |
| 21 } |
OLD | NEW |