| 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> |
| 11 #include <map> | 11 #include <map> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/lock.h" | 14 #include "base/lock.h" |
| 15 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
| 16 #include "base/scoped_handle.h" | 16 #include "base/scoped_handle.h" |
| 17 #include "base/stack_container.h" | 17 #include "base/stack_container.h" |
| 18 #include "base/task.h" | 18 #include "base/task.h" |
| 19 #include "base/thread.h" |
| 19 #include "base/timer.h" | 20 #include "base/timer.h" |
| 20 #include "base/thread.h" | |
| 21 #include "chrome/common/page_zoom.h" | 21 #include "chrome/common/page_zoom.h" |
| 22 #include "chrome/test/automation/automation_proxy.h" | 22 #include "chrome/test/automation/automation_proxy.h" |
| 23 #include "chrome/test/automation/tab_proxy.h" | 23 #include "chrome/test/automation/tab_proxy.h" |
| 24 #include "chrome_frame/chrome_frame_delegate.h" | 24 #include "chrome_frame/chrome_frame_delegate.h" |
| 25 #include "chrome_frame/chrome_frame_histograms.h" | 25 #include "chrome_frame/chrome_frame_histograms.h" |
| 26 #include "chrome_frame/plugin_url_request.h" | 26 #include "chrome_frame/plugin_url_request.h" |
| 27 #include "chrome_frame/sync_msg_reply_dispatcher.h" | 27 #include "chrome_frame/sync_msg_reply_dispatcher.h" |
| 28 | 28 |
| 29 // By a convoluated route, this timeout also winds up being the sync automation | 29 // By a convoluated route, this timeout also winds up being the sync automation |
| 30 // message timeout. See the ChromeFrameAutomationProxyImpl ctor and the | 30 // message timeout. See the ChromeFrameAutomationProxyImpl ctor and the |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 244 } |
| 245 | 245 |
| 246 base::Thread* thread() const { | 246 base::Thread* thread() const { |
| 247 return thread_.get(); | 247 return thread_.get(); |
| 248 } | 248 } |
| 249 | 249 |
| 250 MessageLoop* message_loop() const { | 250 MessageLoop* message_loop() const { |
| 251 return thread_->message_loop(); | 251 return thread_->message_loop(); |
| 252 } | 252 } |
| 253 | 253 |
| 254 bool IsSameThread(PlatformThreadId id) const { | 254 bool IsSameThread(base::PlatformThreadId id) const { |
| 255 return thread_->thread_id() == id; | 255 return thread_->thread_id() == id; |
| 256 } | 256 } |
| 257 | 257 |
| 258 ChromeFrameAutomationProxyImpl* proxy() const { | 258 ChromeFrameAutomationProxyImpl* proxy() const { |
| 259 DCHECK(IsSameThread(PlatformThread::CurrentId())); | 259 DCHECK(IsSameThread(base::PlatformThread::CurrentId())); |
| 260 return proxy_.get(); | 260 return proxy_.get(); |
| 261 } | 261 } |
| 262 | 262 |
| 263 // Called by the proxy when the automation server has unexpectedly gone away. | 263 // Called by the proxy when the automation server has unexpectedly gone away. |
| 264 void OnChannelError(); | 264 void OnChannelError(); |
| 265 | 265 |
| 266 protected: | 266 protected: |
| 267 void CreateProxy(ChromeFrameLaunchParams* params, | 267 void CreateProxy(ChromeFrameLaunchParams* params, |
| 268 LaunchDelegate* delegate); | 268 LaunchDelegate* delegate); |
| 269 void SendUMAData(); | 269 void SendUMAData(); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 virtual void OnReadComplete(int request_id, const std::string& data); | 502 virtual void OnReadComplete(int request_id, const std::string& data); |
| 503 virtual void OnResponseEnd(int request_id, const URLRequestStatus& status); | 503 virtual void OnResponseEnd(int request_id, const URLRequestStatus& status); |
| 504 virtual void OnCookiesRetrieved(bool success, const GURL& url, | 504 virtual void OnCookiesRetrieved(bool success, const GURL& url, |
| 505 const std::string& cookie_string, int cookie_id); | 505 const std::string& cookie_string, int cookie_id); |
| 506 | 506 |
| 507 bool is_initialized() const { | 507 bool is_initialized() const { |
| 508 return init_state_ == INITIALIZED; | 508 return init_state_ == INITIALIZED; |
| 509 } | 509 } |
| 510 | 510 |
| 511 HWND parent_window_; | 511 HWND parent_window_; |
| 512 PlatformThreadId ui_thread_id_; | 512 base::PlatformThreadId ui_thread_id_; |
| 513 | 513 |
| 514 void* automation_server_id_; | 514 void* automation_server_id_; |
| 515 ChromeFrameAutomationProxy* automation_server_; | 515 ChromeFrameAutomationProxy* automation_server_; |
| 516 | 516 |
| 517 HWND chrome_window_; | 517 HWND chrome_window_; |
| 518 scoped_refptr<TabProxy> tab_; | 518 scoped_refptr<TabProxy> tab_; |
| 519 ChromeFrameDelegate* chrome_frame_delegate_; | 519 ChromeFrameDelegate* chrome_frame_delegate_; |
| 520 | 520 |
| 521 // Handle to the underlying chrome window. This is a child of the external | 521 // Handle to the underlying chrome window. This is a child of the external |
| 522 // tab window. | 522 // tab window. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // set to true if the host needs to get notified of all top level navigations | 559 // set to true if the host needs to get notified of all top level navigations |
| 560 // in this page. This typically applies to hosts which would render the new | 560 // in this page. This typically applies to hosts which would render the new |
| 561 // page without chrome frame. Defaults to false. | 561 // page without chrome frame. Defaults to false. |
| 562 bool route_all_top_level_navigations_; | 562 bool route_all_top_level_navigations_; |
| 563 | 563 |
| 564 friend class BeginNavigateContext; | 564 friend class BeginNavigateContext; |
| 565 friend class CreateExternalTabContext; | 565 friend class CreateExternalTabContext; |
| 566 }; | 566 }; |
| 567 | 567 |
| 568 #endif // CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ | 568 #endif // CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ |
| OLD | NEW |