| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 class CFMsgDispatcher; | 77 class CFMsgDispatcher; |
| 78 scoped_refptr<CFMsgDispatcher> sync_; | 78 scoped_refptr<CFMsgDispatcher> sync_; |
| 79 friend class ProxyFactory; | 79 friend class ProxyFactory; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 // This structure contains information used for launching chrome. | 82 // This structure contains information used for launching chrome. |
| 83 struct ChromeFrameLaunchParams { | 83 struct ChromeFrameLaunchParams { |
| 84 int automation_server_launch_timeout; | 84 int automation_server_launch_timeout; |
| 85 GURL url; | 85 GURL url; |
| 86 GURL referrer; | 86 GURL referrer; |
| 87 FilePath profile_path; |
| 87 std::wstring profile_name; | 88 std::wstring profile_name; |
| 88 std::wstring extra_chrome_arguments; | 89 std::wstring extra_chrome_arguments; |
| 89 bool perform_version_check; | 90 bool perform_version_check; |
| 90 bool incognito_mode; | 91 bool incognito_mode; |
| 91 FilePath profile_path; | 92 bool is_widget_mode; |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 // We must create and destroy automation proxy in a thread with a message loop. | 95 // We must create and destroy automation proxy in a thread with a message loop. |
| 95 // Hence thread cannot be a member of the proxy. | 96 // Hence thread cannot be a member of the proxy. |
| 96 class ProxyFactory { | 97 class ProxyFactory { |
| 97 public: | 98 public: |
| 98 // Callback when chrome process launch is complete and automation handshake | 99 // Callback when chrome process launch is complete and automation handshake |
| 99 // (Hello message) is established. | 100 // (Hello message) is established. |
| 100 struct DECLSPEC_NOVTABLE LaunchDelegate { | 101 struct DECLSPEC_NOVTABLE LaunchDelegate { |
| 101 virtual void LaunchComplete(ChromeFrameAutomationProxy* proxy, | 102 virtual void LaunchComplete(ChromeFrameAutomationProxy* proxy, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 public base::RefCountedThreadSafe<ChromeFrameAutomationClient>, | 153 public base::RefCountedThreadSafe<ChromeFrameAutomationClient>, |
| 153 public PluginUrlRequestDelegate, | 154 public PluginUrlRequestDelegate, |
| 154 public TabProxy::TabProxyDelegate, | 155 public TabProxy::TabProxyDelegate, |
| 155 public ProxyFactory::LaunchDelegate { | 156 public ProxyFactory::LaunchDelegate { |
| 156 public: | 157 public: |
| 157 ChromeFrameAutomationClient(); | 158 ChromeFrameAutomationClient(); |
| 158 ~ChromeFrameAutomationClient(); | 159 ~ChromeFrameAutomationClient(); |
| 159 | 160 |
| 160 // Called from UI thread. | 161 // Called from UI thread. |
| 161 virtual bool Initialize(ChromeFrameDelegate* chrome_frame_delegate, | 162 virtual bool Initialize(ChromeFrameDelegate* chrome_frame_delegate, |
| 162 int automation_server_launch_timeout, | 163 const ChromeFrameLaunchParams& chrome_launch_params); |
| 163 bool perform_version_check, | |
| 164 const FilePath& profile_path, | |
| 165 const std::wstring& extra_chrome_arguments, | |
| 166 bool incognito); | |
| 167 void Uninitialize(); | 164 void Uninitialize(); |
| 168 | 165 |
| 169 virtual bool InitiateNavigation(const std::string& url, | 166 virtual bool InitiateNavigation(const std::string& url, |
| 170 const std::string& referrer, | 167 const std::string& referrer, |
| 171 bool is_privileged); | 168 bool is_privileged); |
| 172 virtual bool NavigateToIndex(int index); | 169 virtual bool NavigateToIndex(int index); |
| 173 bool ForwardMessageFromExternalHost(const std::string& message, | 170 bool ForwardMessageFromExternalHost(const std::string& message, |
| 174 const std::string& origin, | 171 const std::string& origin, |
| 175 const std::string& target); | 172 const std::string& target); |
| 176 bool SetProxySettings(const std::string& json_encoded_proxy_settings); | 173 bool SetProxySettings(const std::string& json_encoded_proxy_settings); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 public: | 357 public: |
| 361 void SetUrlFetcher(PluginUrlRequestManager* url_fetcher) { | 358 void SetUrlFetcher(PluginUrlRequestManager* url_fetcher) { |
| 362 DCHECK(url_fetcher != NULL); | 359 DCHECK(url_fetcher != NULL); |
| 363 url_fetcher_ = url_fetcher; | 360 url_fetcher_ = url_fetcher; |
| 364 thread_safe_url_fetcher_ = url_fetcher->IsThreadSafe(); | 361 thread_safe_url_fetcher_ = url_fetcher->IsThreadSafe(); |
| 365 url_fetcher_->set_delegate(this); | 362 url_fetcher_->set_delegate(this); |
| 366 } | 363 } |
| 367 }; | 364 }; |
| 368 | 365 |
| 369 #endif // CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ | 366 #endif // CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ |
| OLD | NEW |