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

Unified Diff: chrome/browser/extensions/extension_declarative_user_script_master.h

Issue 822453002: Introduce HostID and de-couple Extensions from "script injection System" [browser side] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits 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/extension_declarative_user_script_master.h
diff --git a/chrome/browser/extensions/api/spellcheck/spellcheck_api.h b/chrome/browser/extensions/extension_declarative_user_script_master.h
similarity index 36%
copy from chrome/browser/extensions/api/spellcheck/spellcheck_api.h
copy to chrome/browser/extensions/extension_declarative_user_script_master.h
index 9c976af00f239f1a6008656bd2403e33f5c703ea..077f8ca5cf5fe47e9fceb26909add4c4260e8889 100644
--- a/chrome/browser/extensions/api/spellcheck/spellcheck_api.h
+++ b/chrome/browser/extensions/extension_declarative_user_script_master.h
@@ -1,51 +1,43 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// 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.
-#ifndef CHROME_BROWSER_EXTENSIONS_API_SPELLCHECK_SPELLCHECK_API_H_
-#define CHROME_BROWSER_EXTENSIONS_API_SPELLCHECK_SPELLCHECK_API_H_
+#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_DECLARATIVE_USER_SCRIPT_MASTER_H_
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_DECLARATIVE_USER_SCRIPT_MASTER_H_
#include "base/scoped_observer.h"
-#include "extensions/browser/browser_context_keyed_api_factory.h"
+#include "chrome/browser/extensions/declarative_user_script_master.h"
+#include "chrome/browser/extensions/extension_user_script_loader.h"
#include "extensions/browser/extension_registry_observer.h"
+#include "extensions/common/consumer.h"
+#include "extensions/common/extension.h"
+
+class Profile;
namespace extensions {
+
class ExtensionRegistry;
+class UserScript;
-class SpellcheckAPI : public BrowserContextKeyedAPI,
- public ExtensionRegistryObserver {
+// Extension implmentation of DeclarativeUserScriptMaster.
+class ExtensionDeclarativeUserScriptMaster : public DeclarativeUserScriptMaster,
+ public ExtensionRegistryObserver {
public:
- explicit SpellcheckAPI(content::BrowserContext* context);
- ~SpellcheckAPI() override;
-
- // BrowserContextKeyedAPI implementation.
- static BrowserContextKeyedAPIFactory<SpellcheckAPI>* GetFactoryInstance();
+ ExtensionDeclarativeUserScriptMaster(Profile* profile, const ConsumerID& id);
+ ~ExtensionDeclarativeUserScriptMaster() override;
private:
- friend class BrowserContextKeyedAPIFactory<SpellcheckAPI>;
-
// ExtensionRegistryObserver implementation.
- void OnExtensionLoaded(content::BrowserContext* browser_context,
- const Extension* extension) override;
void OnExtensionUnloaded(content::BrowserContext* browser_context,
const Extension* extension,
UnloadedExtensionInfo::Reason reason) override;
- // BrowserContextKeyedAPI implementation.
- static const char* service_name() {
- return "SpellcheckAPI";
- }
-
- // Listen to extension load, unloaded notifications.
ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
extension_registry_observer_;
- DISALLOW_COPY_AND_ASSIGN(SpellcheckAPI);
+ DISALLOW_COPY_AND_ASSIGN(ExtensionDeclarativeUserScriptMaster);
};
-template <>
-void BrowserContextKeyedAPIFactory<SpellcheckAPI>::DeclareFactoryDependencies();
-
} // namespace extensions
-#endif // CHROME_BROWSER_EXTENSIONS_API_SPELLCHECK_SPELLCHECK_API_H_
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DECLARATIVE_USER_SCRIPT_MASTER_H_

Powered by Google App Engine
This is Rietveld 408576698