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_DISPATCHER_H_ | 5 #ifndef EXTENSIONS_RENDERER_DISPATCHER_H_ |
6 #define EXTENSIONS_RENDERER_DISPATCHER_H_ | 6 #define EXTENSIONS_RENDERER_DISPATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
| 11 #include <utility> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/scoped_observer.h" | 14 #include "base/scoped_observer.h" |
14 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
15 #include "content/public/renderer/render_process_observer.h" | 16 #include "content/public/renderer/render_process_observer.h" |
16 #include "extensions/common/event_filter.h" | 17 #include "extensions/common/event_filter.h" |
17 #include "extensions/common/extension_set.h" | 18 #include "extensions/common/extension_set.h" |
18 #include "extensions/common/extensions_client.h" | 19 #include "extensions/common/extensions_client.h" |
19 #include "extensions/common/features/feature.h" | 20 #include "extensions/common/features/feature.h" |
20 #include "extensions/renderer/resource_bundle_source_map.h" | 21 #include "extensions/renderer/resource_bundle_source_map.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Shared implementation of the various MessageInvoke IPCs. | 130 // Shared implementation of the various MessageInvoke IPCs. |
130 void InvokeModuleSystemMethod(content::RenderView* render_view, | 131 void InvokeModuleSystemMethod(content::RenderView* render_view, |
131 const std::string& extension_id, | 132 const std::string& extension_id, |
132 const std::string& module_name, | 133 const std::string& module_name, |
133 const std::string& function_name, | 134 const std::string& function_name, |
134 const base::ListValue& args, | 135 const base::ListValue& args, |
135 bool user_gesture); | 136 bool user_gesture); |
136 | 137 |
137 void ClearPortData(int port_id); | 138 void ClearPortData(int port_id); |
138 | 139 |
| 140 // Returns a list of (module name, resource id) pairs for the JS modules to |
| 141 // add to the source map. |
| 142 static std::vector<std::pair<std::string, int> > GetJsResources(); |
| 143 |
139 private: | 144 private: |
140 friend class ::ChromeRenderViewTest; | 145 friend class ::ChromeRenderViewTest; |
141 FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest, | 146 FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest, |
142 CannotScriptWebstore); | 147 CannotScriptWebstore); |
143 | 148 |
144 // RenderProcessObserver implementation: | 149 // RenderProcessObserver implementation: |
145 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 150 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
146 virtual void WebKitInitialized() OVERRIDE; | 151 virtual void WebKitInitialized() OVERRIDE; |
147 virtual void IdleNotification() OVERRIDE; | 152 virtual void IdleNotification() OVERRIDE; |
148 virtual void OnRenderProcessShutdown() OVERRIDE; | 153 virtual void OnRenderProcessShutdown() OVERRIDE; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 // the observer is destroyed before the UserScriptSet. | 303 // the observer is destroyed before the UserScriptSet. |
299 ScopedObserver<UserScriptSet, UserScriptSet::Observer> | 304 ScopedObserver<UserScriptSet, UserScriptSet::Observer> |
300 user_script_set_observer_; | 305 user_script_set_observer_; |
301 | 306 |
302 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 307 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
303 }; | 308 }; |
304 | 309 |
305 } // namespace extensions | 310 } // namespace extensions |
306 | 311 |
307 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_ | 312 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_ |
OLD | NEW |