OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/shared_memory.h" | 13 #include "base/shared_memory.h" |
14 #include "base/timer.h" | 14 #include "base/timer.h" |
15 #include "content/renderer/render_process_observer.h" | 15 #include "content/renderer/render_process_observer.h" |
16 #include "chrome/common/extensions/extension_set.h" | 16 #include "chrome/common/extensions/extension_set.h" |
17 | 17 |
18 class GURL; | 18 class GURL; |
19 class RenderThread; | 19 class RenderThread; |
20 class URLPattern; | 20 class URLPattern; |
21 class UserScriptSlave; | 21 class UserScriptSlave; |
22 struct ExtensionMsg_Loaded_Params; | 22 struct ExtensionMsg_Loaded_Params; |
| 23 struct ExtensionMsg_UpdatePermissions_Params; |
23 | 24 |
24 namespace base { | 25 namespace base { |
25 class ListValue; | 26 class ListValue; |
26 } | 27 } |
27 | 28 |
28 namespace WebKit { | 29 namespace WebKit { |
29 class WebFrame; | 30 class WebFrame; |
30 } | 31 } |
31 | 32 |
32 namespace v8 { | 33 namespace v8 { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 const GURL& event_url); | 71 const GURL& event_url); |
71 void OnSetFunctionNames(const std::vector<std::string>& names); | 72 void OnSetFunctionNames(const std::vector<std::string>& names); |
72 void OnLoaded(const ExtensionMsg_Loaded_Params& params); | 73 void OnLoaded(const ExtensionMsg_Loaded_Params& params); |
73 void OnUnloaded(const std::string& id); | 74 void OnUnloaded(const std::string& id); |
74 void OnSetScriptingWhitelist( | 75 void OnSetScriptingWhitelist( |
75 const Extension::ScriptingWhitelist& extension_ids); | 76 const Extension::ScriptingWhitelist& extension_ids); |
76 void OnPageActionsUpdated(const std::string& extension_id, | 77 void OnPageActionsUpdated(const std::string& extension_id, |
77 const std::vector<std::string>& page_actions); | 78 const std::vector<std::string>& page_actions); |
78 void OnActivateApplication(const std::string& extension_id); | 79 void OnActivateApplication(const std::string& extension_id); |
79 void OnActivateExtension(const std::string& extension_id); | 80 void OnActivateExtension(const std::string& extension_id); |
| 81 void OnUpdatePermissions(const std::string& extension_id, |
| 82 const ExtensionAPIPermissionSet& apis, |
| 83 const URLPatternSet& explicit_hosts, |
| 84 const URLPatternSet& scriptable_hosts); |
80 void OnUpdateUserScripts(base::SharedMemoryHandle table); | 85 void OnUpdateUserScripts(base::SharedMemoryHandle table); |
81 | 86 |
82 // Update the list of active extensions that will be reported when we crash. | 87 // Update the list of active extensions that will be reported when we crash. |
83 void UpdateActiveExtensions(); | 88 void UpdateActiveExtensions(); |
84 | 89 |
85 // Calls RenderThread's RegisterExtension and keeps tracks of which v8 | 90 // Calls RenderThread's RegisterExtension and keeps tracks of which v8 |
86 // extension is for Chrome Extensions only. | 91 // extension is for Chrome Extensions only. |
87 void RegisterExtension(v8::Extension* extension, bool restrict_to_extensions); | 92 void RegisterExtension(v8::Extension* extension, bool restrict_to_extensions); |
88 | 93 |
89 // Sets up the host permissions for |extension|. | 94 // Sets up the host permissions for |extension|. |
(...skipping 25 matching lines...) Expand all Loading... |
115 // The applications that are active in this process. | 120 // The applications that are active in this process. |
116 std::set<std::string> active_application_ids_; | 121 std::set<std::string> active_application_ids_; |
117 | 122 |
118 // True once WebKit has been initialized (and it is therefore safe to poke). | 123 // True once WebKit has been initialized (and it is therefore safe to poke). |
119 bool is_webkit_initialized_; | 124 bool is_webkit_initialized_; |
120 | 125 |
121 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); | 126 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); |
122 }; | 127 }; |
123 | 128 |
124 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 129 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
OLD | NEW |