OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/extensions/declarative_user_script_manager.h" |
| 6 |
| 7 #include "chrome/browser/extensions/declarative_user_script_master.h" |
| 8 |
| 9 namespace extensions { |
| 10 |
| 11 DeclarativeUserScriptManager::DeclarativeUserScriptManager(Profile* profile) |
| 12 : profile_(profile) { |
| 13 } |
| 14 |
| 15 DeclarativeUserScriptManager::~DeclarativeUserScriptManager() { |
| 16 } |
| 17 |
| 18 DeclarativeUserScriptMaster* |
| 19 DeclarativeUserScriptManager::GetDeclarativeUserScriptMasterByID( |
| 20 const std::string& id) { |
| 21 UserScriptMasterMap::iterator it = declarative_user_script_masters_.find(id); |
| 22 |
| 23 if (it != declarative_user_script_masters_.end()) |
| 24 return it->second.get(); |
| 25 |
| 26 linked_ptr<DeclarativeUserScriptMaster> master( |
| 27 new DeclarativeUserScriptMaster(profile_, id)); |
| 28 declarative_user_script_masters_[id] = master; |
| 29 return master.get(); |
| 30 } |
| 31 |
| 32 } // extensions |
OLD | NEW |