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

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: Use map to store the DeclarativeUserScriptMaster objects. 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 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 ExtensionId& extension_id) {
21 UserScriptMasterMap::iterator it =
22 declarative_user_script_masters_.find(extension_id);
23
24 if (it != declarative_user_script_masters_.end())
25 return (it->second).get();
26
27 linked_ptr<DeclarativeUserScriptMaster> master(
28 new DeclarativeUserScriptMaster(profile_, extension_id));
29 declarative_user_script_masters_[extension_id] = master;
30 return master.get();
31 }
32
33 } // extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698