Chromium Code Reviews| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "chrome/browser/extensions/extension_factory_registry.h" | |
|
Aaron Boodman
2012/03/15 02:27:47
You could forward declare the factory to avoid thi
| |
| 13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 14 #include "ipc/ipc_message.h" | 15 #include "ipc/ipc_message.h" |
| 15 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
| 16 | 17 |
| 17 class Browser; | 18 class Browser; |
| 18 class ChromeRenderMessageFilter; | 19 class ChromeRenderMessageFilter; |
| 19 class Extension; | 20 class Extension; |
| 20 class ExtensionFunction; | 21 class ExtensionFunction; |
| 21 class Profile; | 22 class Profile; |
| 22 struct ExtensionHostMsg_Request_Params; | 23 struct ExtensionHostMsg_Request_Params; |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| 25 class RenderViewHost; | 26 class RenderViewHost; |
| 26 class WebContents; | 27 class WebContents; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace extensions { | 30 namespace extensions { |
| 30 class ProcessMap; | 31 class ProcessMap; |
| 31 } | 32 } |
| 32 | 33 |
| 33 // A factory function for creating new ExtensionFunction instances. | |
| 34 typedef ExtensionFunction* (*ExtensionFunctionFactory)(); | |
| 35 | |
| 36 // ExtensionFunctionDispatcher receives requests to execute functions from | 34 // ExtensionFunctionDispatcher receives requests to execute functions from |
| 37 // Chrome extensions running in a RenderViewHost and dispatches them to the | 35 // Chrome extensions running in a RenderViewHost and dispatches them to the |
| 38 // appropriate handler. It lives entirely on the UI thread. | 36 // appropriate handler. It lives entirely on the UI thread. |
| 39 // | 37 // |
| 40 // ExtensionFunctionDispatcher should be a member of some class that hosts | 38 // ExtensionFunctionDispatcher should be a member of some class that hosts |
| 41 // RenderViewHosts and wants them to be able to display extension content. | 39 // RenderViewHosts and wants them to be able to display extension content. |
| 42 // This class should also implement ExtensionFunctionDispatcher::Delegate. | 40 // This class should also implement ExtensionFunctionDispatcher::Delegate. |
| 43 // | 41 // |
| 44 // Note that a single ExtensionFunctionDispatcher does *not* correspond to a | 42 // 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 | 43 // 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, | 132 static void SendAccessDenied(IPC::Message::Sender* ipc_sender, |
| 135 int routing_id, | 133 int routing_id, |
| 136 int request_id); | 134 int request_id); |
| 137 | 135 |
| 138 Profile* profile_; | 136 Profile* profile_; |
| 139 | 137 |
| 140 Delegate* delegate_; | 138 Delegate* delegate_; |
| 141 }; | 139 }; |
| 142 | 140 |
| 143 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ | 141 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
| OLD | NEW |