OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/browser/declarative_user_script_manager.h" | 5 #include "extensions/browser/declarative_user_script_manager.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "content/public/browser/browser_context.h" | 8 #include "content/public/browser/browser_context.h" |
9 #include "extensions/browser/declarative_user_script_manager_factory.h" | 9 #include "extensions/browser/declarative_user_script_manager_factory.h" |
10 #include "extensions/browser/declarative_user_script_master.h" | 10 #include "extensions/browser/declarative_user_script_master.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 return declarative_user_script_masters_ | 47 return declarative_user_script_masters_ |
48 .insert( | 48 .insert( |
49 std::make_pair(host_id, base::MakeUnique<DeclarativeUserScriptMaster>( | 49 std::make_pair(host_id, base::MakeUnique<DeclarativeUserScriptMaster>( |
50 browser_context_, host_id))) | 50 browser_context_, host_id))) |
51 .first->second.get(); | 51 .first->second.get(); |
52 } | 52 } |
53 | 53 |
54 void DeclarativeUserScriptManager::OnExtensionUnloaded( | 54 void DeclarativeUserScriptManager::OnExtensionUnloaded( |
55 content::BrowserContext* browser_context, | 55 content::BrowserContext* browser_context, |
56 const Extension* extension, | 56 const Extension* extension, |
57 UnloadedExtensionInfo::Reason reason) { | 57 UnloadedExtensionReason reason) { |
58 for (const auto& val : declarative_user_script_masters_) { | 58 for (const auto& val : declarative_user_script_masters_) { |
59 DeclarativeUserScriptMaster* master = val.second.get(); | 59 DeclarativeUserScriptMaster* master = val.second.get(); |
60 if (master->host_id().id() == extension->id()) | 60 if (master->host_id().id() == extension->id()) |
61 master->ClearScripts(); | 61 master->ClearScripts(); |
62 } | 62 } |
63 } | 63 } |
64 | 64 |
65 } // namespace extensions | 65 } // namespace extensions |
OLD | NEW |