OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <map> |
9 #include <string> | 10 #include <string> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "chrome/browser/extensions/extension_factory_registry.h" |
13 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "googleurl/src/gurl.h" |
14 #include "ipc/ipc_message.h" | 17 #include "ipc/ipc_message.h" |
15 #include "googleurl/src/gurl.h" | |
16 | 18 |
17 class Browser; | 19 class Browser; |
18 class ChromeRenderMessageFilter; | 20 class ChromeRenderMessageFilter; |
19 class Extension; | 21 class Extension; |
20 class ExtensionFunction; | 22 class ExtensionFunction; |
21 class Profile; | 23 class Profile; |
22 class RenderViewHost; | 24 class RenderViewHost; |
23 struct ExtensionHostMsg_Request_Params; | 25 struct ExtensionHostMsg_Request_Params; |
24 | 26 |
25 namespace content { | 27 namespace content { |
26 class WebContents; | 28 class WebContents; |
27 } | 29 } |
28 | 30 |
29 namespace extensions { | 31 namespace extensions { |
30 class ProcessMap; | 32 class ProcessMap; |
31 } | 33 } |
32 | 34 |
33 // A factory function for creating new ExtensionFunction instances. | |
34 typedef ExtensionFunction* (*ExtensionFunctionFactory)(); | |
35 | |
36 // ExtensionFunctionDispatcher receives requests to execute functions from | 35 // ExtensionFunctionDispatcher receives requests to execute functions from |
37 // Chrome extensions running in a RenderViewHost and dispatches them to the | 36 // Chrome extensions running in a RenderViewHost and dispatches them to the |
38 // appropriate handler. It lives entirely on the UI thread. | 37 // appropriate handler. It lives entirely on the UI thread. |
39 // | 38 // |
40 // ExtensionFunctionDispatcher should be a member of some class that hosts | 39 // ExtensionFunctionDispatcher should be a member of some class that hosts |
41 // RenderViewHosts and wants them to be able to display extension content. | 40 // RenderViewHosts and wants them to be able to display extension content. |
42 // This class should also implement ExtensionFunctionDispatcher::Delegate. | 41 // This class should also implement ExtensionFunctionDispatcher::Delegate. |
43 // | 42 // |
44 // Note that a single ExtensionFunctionDispatcher does *not* correspond to a | 43 // Note that a single ExtensionFunctionDispatcher does *not* correspond to a |
45 // single RVH, a single extension, or a single URL. This is by design so that | 44 // single RVH, a single extension, or a single URL. This is by design so that |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 static void SendAccessDenied(IPC::Message::Sender* ipc_sender, | 133 static void SendAccessDenied(IPC::Message::Sender* ipc_sender, |
135 int routing_id, | 134 int routing_id, |
136 int request_id); | 135 int request_id); |
137 | 136 |
138 Profile* profile_; | 137 Profile* profile_; |
139 | 138 |
140 Delegate* delegate_; | 139 Delegate* delegate_; |
141 }; | 140 }; |
142 | 141 |
143 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ | 142 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
OLD | NEW |