| 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 "chrome/browser/extensions/declarative_user_script_master.h" | 5 #include "extensions/browser/declarative_user_script_master.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "content/public/browser/browser_context.h" |
| 10 | 10 |
| 11 namespace extensions { | 11 namespace extensions { |
| 12 | 12 |
| 13 DeclarativeUserScriptMaster::DeclarativeUserScriptMaster(Profile* profile, | 13 DeclarativeUserScriptMaster::DeclarativeUserScriptMaster( |
| 14 const HostID& host_id) | 14 content::BrowserContext* browser_context, |
| 15 const HostID& host_id) |
| 15 : host_id_(host_id), | 16 : host_id_(host_id), |
| 16 loader_(profile, | 17 loader_(browser_context, |
| 17 host_id, | 18 host_id, |
| 18 false /* listen_for_extension_system_loaded */) { | 19 false /* listen_for_extension_system_loaded */) { |
| 19 } | 20 } |
| 20 | 21 |
| 21 DeclarativeUserScriptMaster::~DeclarativeUserScriptMaster() { | 22 DeclarativeUserScriptMaster::~DeclarativeUserScriptMaster() { |
| 22 } | 23 } |
| 23 | 24 |
| 24 void DeclarativeUserScriptMaster::AddScript(const UserScript& script) { | 25 void DeclarativeUserScriptMaster::AddScript(const UserScript& script) { |
| 25 std::set<UserScript> set; | 26 std::set<UserScript> set; |
| 26 set.insert(script); | 27 set.insert(script); |
| 27 loader_.AddScripts(set); | 28 loader_.AddScripts(set); |
| 28 } | 29 } |
| 29 | 30 |
| 30 void DeclarativeUserScriptMaster::RemoveScript(const UserScript& script) { | 31 void DeclarativeUserScriptMaster::RemoveScript(const UserScript& script) { |
| 31 std::set<UserScript> set; | 32 std::set<UserScript> set; |
| 32 set.insert(script); | 33 set.insert(script); |
| 33 loader_.RemoveScripts(set); | 34 loader_.RemoveScripts(set); |
| 34 } | 35 } |
| 35 | 36 |
| 36 void DeclarativeUserScriptMaster::ClearScripts() { | 37 void DeclarativeUserScriptMaster::ClearScripts() { |
| 37 loader_.ClearScripts(); | 38 loader_.ClearScripts(); |
| 38 } | 39 } |
| 39 | 40 |
| 40 } // namespace extensions | 41 } // namespace extensions |
| OLD | NEW |