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

Unified 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: Move back to extensions namespace. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/declarative_user_script_manager.cc
diff --git a/chrome/browser/extensions/declarative_user_script_manager.cc b/chrome/browser/extensions/declarative_user_script_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e740b5b4f4e25c94889afcea7c8d1f92cecc1eb6
--- /dev/null
+++ b/chrome/browser/extensions/declarative_user_script_manager.cc
@@ -0,0 +1,32 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/declarative_user_script_manager.h"
+
+#include "chrome/browser/extensions/declarative_user_script_master.h"
+
+namespace extensions {
+
+DeclarativeUserScriptManager::DeclarativeUserScriptManager(Profile* profile)
+ : profile_(profile) {
+}
+
+DeclarativeUserScriptManager::~DeclarativeUserScriptManager() {
+}
+
+DeclarativeUserScriptMaster*
+DeclarativeUserScriptManager::GetDeclarativeUserScriptMasterByID(
+ const std::string& id) {
+ UserScriptMasterMap::iterator it = declarative_user_script_masters_.find(id);
+
+ if (it != declarative_user_script_masters_.end())
+ return it->second.get();
+
+ linked_ptr<DeclarativeUserScriptMaster> master(
+ new DeclarativeUserScriptMaster(profile_, id));
+ declarative_user_script_masters_[id] = master;
+ return master.get();
+}
+
+} // extensions

Powered by Google App Engine
This is Rietveld 408576698