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

Unified Diff: chrome/browser/extensions/declarative_user_script_manager.cc

Issue 955473002: Move DeclarativeUserScriptManager/Master and UserScriptLoader to //extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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
deleted file mode 100644
index 2065502887f8661a2bfda30929f0e48cb1cecfec..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/declarative_user_script_manager.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// 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"
-#include "chrome/browser/profiles/profile.h"
-#include "extensions/browser/extension_registry.h"
-
-namespace extensions {
-
-DeclarativeUserScriptManager::DeclarativeUserScriptManager(Profile* profile)
- : profile_(profile), extension_registry_observer_(this) {
- extension_registry_observer_.Add(ExtensionRegistry::Get(profile));
-}
-
-DeclarativeUserScriptManager::~DeclarativeUserScriptManager() {
-}
-
-DeclarativeUserScriptMaster*
-DeclarativeUserScriptManager::GetDeclarativeUserScriptMasterByID(
- const HostID& host_id) {
- UserScriptMasterMap::iterator it =
- declarative_user_script_masters_.find(host_id);
-
- if (it != declarative_user_script_masters_.end())
- return it->second.get();
-
- return CreateDeclarativeUserScriptMaster(host_id);
-}
-
-DeclarativeUserScriptMaster*
-DeclarativeUserScriptManager::CreateDeclarativeUserScriptMaster(
- const HostID& host_id) {
- linked_ptr<DeclarativeUserScriptMaster> master(
- new DeclarativeUserScriptMaster(profile_, host_id));
- declarative_user_script_masters_[host_id] = master;
- return master.get();
-}
-
-void DeclarativeUserScriptManager::OnExtensionUnloaded(
- content::BrowserContext* browser_context,
- const Extension* extension,
- UnloadedExtensionInfo::Reason reason) {
- for (const auto& val : declarative_user_script_masters_) {
- DeclarativeUserScriptMaster* master = val.second.get();
- if (master->host_id().id() == extension->id())
- master->ClearScripts();
- }
-}
-
-} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698