Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: chrome/browser/extensions/declarative_user_script_manager.cc

Issue 796453003: Introduce DeclarativeUserScriptManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated based on Devlin@'s comments. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698