| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2014 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/extensions/user_script_master_manager.h" |
| 6 |
| 7 #include "chrome/browser/extensions/shared_user_script_master.h" |
| 8 #include "chrome/browser/profiles/profile.h" |
| 9 |
| 10 namespace extensions { |
| 11 |
| 12 UserScriptMasterManager::UserScriptMasterManager(Profile* profile) |
| 13 : profile_(profile), |
| 14 shared_master_(new SharedUserScriptMaster(profile)), |
| 15 extension_registry_observer_(this) { |
| 16 extension_registry_observer_.Add(ExtensionRegistry::Get(profile)); |
| 17 } |
| 18 |
| 19 UserScriptMasterManager::~UserScriptMasterManager() { |
| 20 } |
| 21 |
| 22 void UserScriptMasterManager::OnExtensionLoaded( |
| 23 content::BrowserContext* browser_context, |
| 24 const Extension* extension) { |
| 25 } |
| 26 |
| 27 void UserScriptMasterManager::OnExtensionUnloaded( |
| 28 content::BrowserContext* browser_context, |
| 29 const Extension* extension, |
| 30 UnloadedExtensionInfo::Reason reason) { |
| 31 const ExtensionId& id = extension->id(); |
| 32 if (declarative_masters_.find(id) != declarative_masters_.end()) { |
| 33 declarative_masters_.get(id)->ClearScripts(); |
| 34 } |
| 35 } |
| 36 |
| 37 } // namespace extensions |
| OLD | NEW |