| OLD | NEW |
| 1 // Copyright (c) 2010 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> |
| 11 #include <map> | 11 #include <map> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 std::wstring profile_name; | 87 std::wstring profile_name; |
| 88 std::wstring extra_chrome_arguments; | 88 std::wstring extra_chrome_arguments; |
| 89 bool perform_version_check; | 89 bool perform_version_check; |
| 90 bool incognito_mode; | 90 bool incognito_mode; |
| 91 FilePath profile_path; | |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 // We must create and destroy automation proxy in a thread with a message loop. | 93 // We must create and destroy automation proxy in a thread with a message loop. |
| 95 // Hence thread cannot be a member of the proxy. | 94 // Hence thread cannot be a member of the proxy. |
| 96 class ProxyFactory { | 95 class ProxyFactory { |
| 97 public: | 96 public: |
| 98 // Callback when chrome process launch is complete and automation handshake | 97 // Callback when chrome process launch is complete and automation handshake |
| 99 // (Hello message) is established. | 98 // (Hello message) is established. |
| 100 struct DECLSPEC_NOVTABLE LaunchDelegate { | 99 struct DECLSPEC_NOVTABLE LaunchDelegate { |
| 101 virtual void LaunchComplete(ChromeFrameAutomationProxy* proxy, | 100 virtual void LaunchComplete(ChromeFrameAutomationProxy* proxy, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 public TabProxy::TabProxyDelegate, | 153 public TabProxy::TabProxyDelegate, |
| 155 public ProxyFactory::LaunchDelegate { | 154 public ProxyFactory::LaunchDelegate { |
| 156 public: | 155 public: |
| 157 ChromeFrameAutomationClient(); | 156 ChromeFrameAutomationClient(); |
| 158 ~ChromeFrameAutomationClient(); | 157 ~ChromeFrameAutomationClient(); |
| 159 | 158 |
| 160 // Called from UI thread. | 159 // Called from UI thread. |
| 161 virtual bool Initialize(ChromeFrameDelegate* chrome_frame_delegate, | 160 virtual bool Initialize(ChromeFrameDelegate* chrome_frame_delegate, |
| 162 int automation_server_launch_timeout, | 161 int automation_server_launch_timeout, |
| 163 bool perform_version_check, | 162 bool perform_version_check, |
| 164 const FilePath& profile_path, | 163 const std::wstring& profile_name, |
| 165 const std::wstring& extra_chrome_arguments, | 164 const std::wstring& extra_chrome_arguments, |
| 166 bool incognito); | 165 bool incognito); |
| 167 void Uninitialize(); | 166 void Uninitialize(); |
| 168 | 167 |
| 169 virtual bool InitiateNavigation(const std::string& url, | 168 virtual bool InitiateNavigation(const std::string& url, |
| 170 const std::string& referrer, | 169 const std::string& referrer, |
| 171 bool is_privileged); | 170 bool is_privileged); |
| 172 virtual bool NavigateToIndex(int index); | 171 virtual bool NavigateToIndex(int index); |
| 173 bool ForwardMessageFromExternalHost(const std::string& message, | 172 bool ForwardMessageFromExternalHost(const std::string& message, |
| 174 const std::string& origin, | 173 const std::string& origin, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // is reused. | 255 // is reused. |
| 257 bool Reinitialize(ChromeFrameDelegate* chrome_frame_delegate, | 256 bool Reinitialize(ChromeFrameDelegate* chrome_frame_delegate, |
| 258 PluginUrlRequestManager* url_fetcher); | 257 PluginUrlRequestManager* url_fetcher); |
| 259 | 258 |
| 260 // Attaches an existing external tab to this automation client instance. | 259 // Attaches an existing external tab to this automation client instance. |
| 261 void AttachExternalTab(uint64 external_tab_cookie); | 260 void AttachExternalTab(uint64 external_tab_cookie); |
| 262 void BlockExternalTab(uint64 cookie); | 261 void BlockExternalTab(uint64 cookie); |
| 263 | 262 |
| 264 void SetPageFontSize(enum AutomationPageFontSize); | 263 void SetPageFontSize(enum AutomationPageFontSize); |
| 265 | 264 |
| 266 // For IDeleteBrowsingHistorySupport | |
| 267 void RemoveBrowsingData(int remove_mask); | |
| 268 | |
| 269 ChromeFrameAutomationProxy* automation_server() { | 265 ChromeFrameAutomationProxy* automation_server() { |
| 270 return automation_server_; | 266 return automation_server_; |
| 271 } | 267 } |
| 272 | 268 |
| 273 protected: | 269 protected: |
| 274 // ChromeFrameAutomationProxy::LaunchDelegate implementation. | 270 // ChromeFrameAutomationProxy::LaunchDelegate implementation. |
| 275 virtual void LaunchComplete(ChromeFrameAutomationProxy* proxy, | 271 virtual void LaunchComplete(ChromeFrameAutomationProxy* proxy, |
| 276 AutomationLaunchResult result); | 272 AutomationLaunchResult result); |
| 277 // TabProxyDelegate implementation | 273 // TabProxyDelegate implementation |
| 278 virtual void OnMessageReceived(TabProxy* tab, const IPC::Message& msg); | 274 virtual void OnMessageReceived(TabProxy* tab, const IPC::Message& msg); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 public: | 356 public: |
| 361 void SetUrlFetcher(PluginUrlRequestManager* url_fetcher) { | 357 void SetUrlFetcher(PluginUrlRequestManager* url_fetcher) { |
| 362 DCHECK(url_fetcher != NULL); | 358 DCHECK(url_fetcher != NULL); |
| 363 url_fetcher_ = url_fetcher; | 359 url_fetcher_ = url_fetcher; |
| 364 thread_safe_url_fetcher_ = url_fetcher->IsThreadSafe(); | 360 thread_safe_url_fetcher_ = url_fetcher->IsThreadSafe(); |
| 365 url_fetcher_->set_delegate(this); | 361 url_fetcher_->set_delegate(this); |
| 366 } | 362 } |
| 367 }; | 363 }; |
| 368 | 364 |
| 369 #endif // CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ | 365 #endif // CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ |
| OLD | NEW |