OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
Devlin
2014/08/04 18:33:26
no (c)
Mark Dittmer
2014/08/05 20:33:20
Done.
| |
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, | |
Devlin
2014/08/04 18:33:26
Why?
Mark Dittmer
2014/08/05 20:33:20
Good question. I erroneously presumed that OnExten
| |
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()) { | |
Devlin
2014/08/04 18:33:26
We could just have the DeclUSM listen for this.
Mark Dittmer
2014/08/05 20:33:20
Done.
| |
33 declarative_masters_.get(id)->ClearScripts(); | |
34 } | |
35 } | |
36 | |
37 } // namespace extensions | |
OLD | NEW |