OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef EXTENSIONS_RENDERER_USER_SCRIPT_SET_MANAGER_H_ | 5 #ifndef EXTENSIONS_RENDERER_USER_SCRIPT_SET_MANAGER_H_ |
6 #define EXTENSIONS_RENDERER_USER_SCRIPT_SET_MANAGER_H_ | 6 #define EXTENSIONS_RENDERER_USER_SCRIPT_SET_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const std::vector<UserScript*>& scripts) = 0; | 49 const std::vector<UserScript*>& scripts) = 0; |
50 }; | 50 }; |
51 | 51 |
52 UserScriptSetManager(const ExtensionSet* extensions); | 52 UserScriptSetManager(const ExtensionSet* extensions); |
53 | 53 |
54 ~UserScriptSetManager() override; | 54 ~UserScriptSetManager() override; |
55 | 55 |
56 void AddObserver(Observer* observer); | 56 void AddObserver(Observer* observer); |
57 void RemoveObserver(Observer* observer); | 57 void RemoveObserver(Observer* observer); |
58 | 58 |
59 // Looks up the script injection associated with |script_id| and |extension| | 59 // Looks up the script injection associated with |script_id| and |
60 // in the context of the given |web_frame|, |tab_id|, and |url|. | 60 // |extension_id| in the context of the given |web_frame|, |tab_id|, |
| 61 // and |url|. |
61 scoped_ptr<ScriptInjection> GetInjectionForDeclarativeScript( | 62 scoped_ptr<ScriptInjection> GetInjectionForDeclarativeScript( |
62 int script_id, | 63 int script_id, |
63 blink::WebFrame* web_frame, | 64 blink::WebFrame* web_frame, |
64 int tab_id, | 65 int tab_id, |
65 const GURL& url, | 66 const GURL& url, |
66 const Extension* extension); | 67 const std::string& extension_id); |
67 | 68 |
68 // Append all injections from |static_scripts| and each of | 69 // Append all injections from |static_scripts| and each of |
69 // |programmatic_scripts_| to |injections|. | 70 // |programmatic_scripts_| to |injections|. |
70 void GetAllInjections(ScopedVector<ScriptInjection>* injections, | 71 void GetAllInjections(ScopedVector<ScriptInjection>* injections, |
71 blink::WebFrame* web_frame, | 72 blink::WebFrame* web_frame, |
72 int tab_id, | 73 int tab_id, |
73 UserScript::RunLocation run_location); | 74 UserScript::RunLocation run_location); |
74 | 75 |
75 // Get active extension IDs from |static_scripts| and each of | 76 // Get active extension IDs from |static_scripts| and each of |
76 // |programmatic_scripts_|. | 77 // |programmatic_scripts_|. |
(...skipping 28 matching lines...) Expand all Loading... |
105 | 106 |
106 // The associated observers. | 107 // The associated observers. |
107 ObserverList<Observer> observers_; | 108 ObserverList<Observer> observers_; |
108 | 109 |
109 DISALLOW_COPY_AND_ASSIGN(UserScriptSetManager); | 110 DISALLOW_COPY_AND_ASSIGN(UserScriptSetManager); |
110 }; | 111 }; |
111 | 112 |
112 } // namespace extensions | 113 } // namespace extensions |
113 | 114 |
114 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_SET_MANAGER_H_ | 115 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_SET_MANAGER_H_ |
OLD | NEW |