Index: chrome/browser/extensions/declarative_user_script_manager.h |
diff --git a/chrome/browser/extensions/declarative_user_script_manager.h b/chrome/browser/extensions/declarative_user_script_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9172de5d26112bc329d8ea925349a782e8039895 |
--- /dev/null |
+++ b/chrome/browser/extensions/declarative_user_script_manager.h |
@@ -0,0 +1,43 @@ |
+// 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_DECLARATIVE_USER_SCRIPT_MANAGER_H_ |
+#define CHROME_BROWSER_EXTENSIONS_DECLARATIVE_USER_SCRIPT_MANAGER_H_ |
+ |
+#include <map> |
+ |
+#include "base/macros.h" |
+#include "base/memory/linked_ptr.h" |
+ |
+class Profile; |
+ |
+namespace extensions { |
Devlin
2014/12/12 20:02:45
hmm... actually, for as long as this class is in c
Xi Han
2014/12/12 20:32:31
That is ok, add the namespace back.
|
+class DeclarativeUserScriptMaster; |
+} |
+ |
+using UserScriptMasterMap = |
Devlin
2014/12/12 20:02:45
nit: When I mentioned this should go above class m
Xi Han
2014/12/12 20:32:31
Done.
|
+std::map<std::string, linked_ptr<extensions::DeclarativeUserScriptMaster>>; |
+ |
+// Manages a set of DeclarativeUserScriptMaster objects for script injections. |
+class DeclarativeUserScriptManager { |
+ public: |
+ explicit DeclarativeUserScriptManager(Profile* profile); |
+ ~DeclarativeUserScriptManager(); |
+ |
+ // Get the user script master for declarative scripts; if does not exist, a |
Devlin
2014/12/12 20:02:45
nit: "if one does not exist" instead of "if does n
Xi Han
2014/12/12 20:32:31
Done.
Xi Han
2014/12/12 20:32:31
Done.
|
+ // new object will be created. |
+ extensions::DeclarativeUserScriptMaster* GetDeclarativeUserScriptMasterByID( |
+ const std::string& id); |
+ |
+ private: |
+ // Manages a set of DeclarativeUserScript objects for programmatically |
Devlin
2014/12/12 20:02:45
This seems more like a comment of the full class (
Xi Han
2014/12/12 20:32:31
Sounds better. Updated.
|
+ // declared scripts. The objects are instantiated lazily. |
+ UserScriptMasterMap declarative_user_script_masters_; |
+ |
+ Profile* profile_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(DeclarativeUserScriptManager); |
+}; |
+ |
+#endif // CHROME_BROWSER_EXTENSIONS_DECLARATIVE_USER_SCRIPT_MANAGER_H_ |