| 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 ListValue; | |
| 20 class RenderThread; | 19 class RenderThread; |
| 21 class URLPattern; | 20 class URLPattern; |
| 22 class UserScriptSlave; | 21 class UserScriptSlave; |
| 23 struct ExtensionMsg_Loaded_Params; | 22 struct ExtensionMsg_Loaded_Params; |
| 24 | 23 |
| 24 namespace base { |
| 25 class ListValue; |
| 26 } |
| 27 |
| 25 namespace WebKit { | 28 namespace WebKit { |
| 26 class WebFrame; | 29 class WebFrame; |
| 27 } | 30 } |
| 28 | 31 |
| 29 namespace v8 { | 32 namespace v8 { |
| 30 class Extension; | 33 class Extension; |
| 31 } | 34 } |
| 32 | 35 |
| 33 // Dispatches extension control messages sent to the renderer and stores | 36 // Dispatches extension control messages sent to the renderer and stores |
| 34 // renderer extension related state. | 37 // renderer extension related state. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 56 private: | 59 private: |
| 57 friend class RenderViewTest; | 60 friend class RenderViewTest; |
| 58 | 61 |
| 59 // RenderProcessObserver implementation: | 62 // RenderProcessObserver implementation: |
| 60 virtual bool OnControlMessageReceived(const IPC::Message& message); | 63 virtual bool OnControlMessageReceived(const IPC::Message& message); |
| 61 virtual void WebKitInitialized(); | 64 virtual void WebKitInitialized(); |
| 62 virtual void IdleNotification(); | 65 virtual void IdleNotification(); |
| 63 | 66 |
| 64 void OnMessageInvoke(const std::string& extension_id, | 67 void OnMessageInvoke(const std::string& extension_id, |
| 65 const std::string& function_name, | 68 const std::string& function_name, |
| 66 const ListValue& args, | 69 const base::ListValue& args, |
| 67 const GURL& event_url); | 70 const GURL& event_url); |
| 68 void OnSetFunctionNames(const std::vector<std::string>& names); | 71 void OnSetFunctionNames(const std::vector<std::string>& names); |
| 69 void OnLoaded(const ExtensionMsg_Loaded_Params& params); | 72 void OnLoaded(const ExtensionMsg_Loaded_Params& params); |
| 70 void OnUnloaded(const std::string& id); | 73 void OnUnloaded(const std::string& id); |
| 71 void OnSetScriptingWhitelist( | 74 void OnSetScriptingWhitelist( |
| 72 const Extension::ScriptingWhitelist& extension_ids); | 75 const Extension::ScriptingWhitelist& extension_ids); |
| 73 void OnPageActionsUpdated(const std::string& extension_id, | 76 void OnPageActionsUpdated(const std::string& extension_id, |
| 74 const std::vector<std::string>& page_actions); | 77 const std::vector<std::string>& page_actions); |
| 75 void OnActivateApplication(const std::string& extension_id); | 78 void OnActivateApplication(const std::string& extension_id); |
| 76 void OnActivateExtension(const std::string& extension_id); | 79 void OnActivateExtension(const std::string& extension_id); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // The applications that are active in this process. | 115 // The applications that are active in this process. |
| 113 std::set<std::string> active_application_ids_; | 116 std::set<std::string> active_application_ids_; |
| 114 | 117 |
| 115 // True once WebKit has been initialized (and it is therefore safe to poke). | 118 // True once WebKit has been initialized (and it is therefore safe to poke). |
| 116 bool is_webkit_initialized_; | 119 bool is_webkit_initialized_; |
| 117 | 120 |
| 118 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); | 121 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); |
| 119 }; | 122 }; |
| 120 | 123 |
| 121 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 124 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
| OLD | NEW |