Chromium Code Reviews| 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 DeclarativeUserScriptManager::DeclarativeUserScriptManager(Profile* profile) | |
| 10 : profile_(profile) { | |
| 11 } | |
| 12 | |
| 13 DeclarativeUserScriptManager::~DeclarativeUserScriptManager() { | |
| 14 } | |
| 15 | |
| 16 extensions::DeclarativeUserScriptMaster* | |
| 17 DeclarativeUserScriptManager::GetDeclarativeUserScriptMasterByID( | |
| 18 const std::string& id) { | |
| 19 UserScriptMasterMap::iterator it = declarative_user_script_masters_.find(id); | |
| 20 | |
| 21 if (it != declarative_user_script_masters_.end()) | |
| 22 return (it->second).get(); | |
|
Devlin
2014/12/12 20:02:45
nit: don't need parens around (it->second).
Xi Han
2014/12/12 20:32:31
Done.
| |
| 23 | |
| 24 linked_ptr<extensions::DeclarativeUserScriptMaster> master( | |
| 25 new extensions::DeclarativeUserScriptMaster(profile_, id)); | |
| 26 declarative_user_script_masters_[id] = master; | |
| 27 return master.get(); | |
| 28 } | |
| OLD | NEW |