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

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: 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 #include "content/public/browser/browser_context.h"
9
10 namespace extensions {
11
12 DeclarativeUserScriptManager::DeclarativeUserScriptManager(Profile* profile)
13 : profile_(profile) {
14 }
15
16 DeclarativeUserScriptManager::~DeclarativeUserScriptManager() {
17 }
18
19 DeclarativeUserScriptMaster*
20 DeclarativeUserScriptManager::GetDeclarativeUserScriptMasterByID(
21 const ExtensionId& extension_id) {
22 DeclarativeUserScriptMaster* master = NULL;
23 for (ScopedVector<DeclarativeUserScriptMaster>::iterator it =
Fady Samuel 2014/12/11 19:58:27 Why not use a map?
24 declarative_user_script_masters_.begin();
25 it != declarative_user_script_masters_.end();
26 ++it) {
27 if ((*it)->extension_id() == extension_id) {
28 master = *it;
29 break;
30 }
31 }
32 if (!master) {
33 master = new DeclarativeUserScriptMaster(profile_, extension_id);
34 declarative_user_script_masters_.push_back(master);
35 }
36 return master;
37 }
38
39 } // extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/declarative_user_script_manager.h ('k') | chrome/browser/extensions/extension_system_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698