| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_FRAME_CHROME_FRAME_AUTOMATION_H_ | 5 #ifndef CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ |
| 6 #define CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ | 6 #define CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlwin.h> | 9 #include <atlwin.h> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 struct DECLSPEC_NOVTABLE ChromeFrameAutomationProxy { | 34 struct DECLSPEC_NOVTABLE ChromeFrameAutomationProxy { |
| 35 virtual bool Send(IPC::Message* msg) = 0; | 35 virtual bool Send(IPC::Message* msg) = 0; |
| 36 | 36 |
| 37 virtual void SendAsAsync(IPC::SyncMessage* msg, void* callback, | 37 virtual void SendAsAsync(IPC::SyncMessage* msg, void* callback, |
| 38 void* key) = 0; | 38 void* key) = 0; |
| 39 virtual void CancelAsync(void* key) = 0; | 39 virtual void CancelAsync(void* key) = 0; |
| 40 virtual scoped_refptr<TabProxy> CreateTabProxy(int handle) = 0; | 40 virtual scoped_refptr<TabProxy> CreateTabProxy(int handle) = 0; |
| 41 virtual std::string server_version() = 0; | 41 virtual std::string server_version() = 0; |
| 42 | 42 |
| 43 virtual void SendProxyConfig(const std::string&) = 0; | 43 virtual void SendProxyConfig(const std::string&) = 0; |
| 44 virtual void SetEnableExtensionAutomation( | |
| 45 const std::vector<std::string>& functions_enabled) = 0; | |
| 46 protected: | 44 protected: |
| 47 ~ChromeFrameAutomationProxy() {} | 45 ~ChromeFrameAutomationProxy() {} |
| 48 }; | 46 }; |
| 49 | 47 |
| 50 // We extend the AutomationProxy class to handle our custom | 48 // We extend the AutomationProxy class to handle our custom |
| 51 // IPC messages | 49 // IPC messages |
| 52 class ChromeFrameAutomationProxyImpl : public ChromeFrameAutomationProxy, | 50 class ChromeFrameAutomationProxyImpl : public ChromeFrameAutomationProxy, |
| 53 // We have to derive from automationproxy since we want access to some members | 51 // We have to derive from automationproxy since we want access to some members |
| 54 // (tracker_ & channel_) - simple aggregation wont work; | 52 // (tracker_ & channel_) - simple aggregation wont work; |
| 55 // .. and non-public inheritance is verboten. | 53 // .. and non-public inheritance is verboten. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 66 | 64 |
| 67 | 65 |
| 68 virtual bool Send(IPC::Message* msg) { | 66 virtual bool Send(IPC::Message* msg) { |
| 69 return AutomationProxy::Send(msg); | 67 return AutomationProxy::Send(msg); |
| 70 } | 68 } |
| 71 | 69 |
| 72 virtual void SendProxyConfig(const std::string& p) { | 70 virtual void SendProxyConfig(const std::string& p) { |
| 73 AutomationProxy::SendProxyConfig(p); | 71 AutomationProxy::SendProxyConfig(p); |
| 74 } | 72 } |
| 75 | 73 |
| 76 virtual void SetEnableExtensionAutomation( | |
| 77 const std::vector<std::string>& functions_enabled) { | |
| 78 AutomationProxy::SetEnableExtensionAutomation(functions_enabled); | |
| 79 } | |
| 80 | |
| 81 protected: | 74 protected: |
| 82 explicit ChromeFrameAutomationProxyImpl(int launch_timeout); | 75 explicit ChromeFrameAutomationProxyImpl(int launch_timeout); |
| 83 ~ChromeFrameAutomationProxyImpl(); | 76 ~ChromeFrameAutomationProxyImpl(); |
| 84 class CFMsgDispatcher; | 77 class CFMsgDispatcher; |
| 85 scoped_refptr<CFMsgDispatcher> sync_; | 78 scoped_refptr<CFMsgDispatcher> sync_; |
| 86 friend class ProxyFactory; | 79 friend class ProxyFactory; |
| 87 }; | 80 }; |
| 88 | 81 |
| 89 // We must create and destroy automation proxy in a thread with a message loop. | 82 // We must create and destroy automation proxy in a thread with a message loop. |
| 90 // Hence thread cannot be a member of the proxy. | 83 // Hence thread cannot be a member of the proxy. |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 InitializationState init_state_; | 341 InitializationState init_state_; |
| 349 bool use_chrome_network_; | 342 bool use_chrome_network_; |
| 350 bool handle_top_level_requests_; | 343 bool handle_top_level_requests_; |
| 351 ProxyFactory* proxy_factory_; | 344 ProxyFactory* proxy_factory_; |
| 352 int tab_handle_; | 345 int tab_handle_; |
| 353 // Only used if we attach to an existing tab. | 346 // Only used if we attach to an existing tab. |
| 354 intptr_t external_tab_cookie_; | 347 intptr_t external_tab_cookie_; |
| 355 }; | 348 }; |
| 356 | 349 |
| 357 #endif // CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ | 350 #endif // CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ |
| OLD | NEW |