| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "chrome/test/automation/tab_proxy.h" | 5 #include "chrome/test/automation/tab_proxy.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/common/json_value_serializer.h" | 10 #include "chrome/common/json_value_serializer.h" |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 } | 634 } |
| 635 | 635 |
| 636 bool TabProxy::ProcessUnhandledAccelerator(const MSG& msg) { | 636 bool TabProxy::ProcessUnhandledAccelerator(const MSG& msg) { |
| 637 if (!is_valid()) | 637 if (!is_valid()) |
| 638 return false; | 638 return false; |
| 639 return sender_->Send( | 639 return sender_->Send( |
| 640 new AutomationMsg_ProcessUnhandledAccelerator(0, handle_, msg)); | 640 new AutomationMsg_ProcessUnhandledAccelerator(0, handle_, msg)); |
| 641 // This message expects no response | 641 // This message expects no response |
| 642 } | 642 } |
| 643 | 643 |
| 644 bool TabProxy::SetInitialFocus(bool reverse) { | |
| 645 if (!is_valid()) | |
| 646 return false; | |
| 647 return sender_->Send( | |
| 648 new AutomationMsg_SetInitialFocus(0, handle_, reverse)); | |
| 649 // This message expects no response | |
| 650 } | |
| 651 | |
| 652 bool TabProxy::WaitForTabToBeRestored(uint32 timeout_ms) { | 644 bool TabProxy::WaitForTabToBeRestored(uint32 timeout_ms) { |
| 653 if (!is_valid()) | 645 if (!is_valid()) |
| 654 return false; | 646 return false; |
| 655 IPC::Message* response = NULL; | 647 IPC::Message* response = NULL; |
| 656 bool is_timeout; | 648 bool is_timeout; |
| 657 bool succeeded = sender_->SendAndWaitForResponseWithTimeout( | 649 bool succeeded = sender_->SendAndWaitForResponseWithTimeout( |
| 658 new AutomationMsg_WaitForTabToBeRestored(0, handle_), &response, | 650 new AutomationMsg_WaitForTabToBeRestored(0, handle_), &response, |
| 659 AutomationMsg_TabFinishedRestoring::ID, timeout_ms, &is_timeout); | 651 AutomationMsg_TabFinishedRestoring::ID, timeout_ms, &is_timeout); |
| 660 scoped_ptr<IPC::Message> response_deleter(response); | 652 scoped_ptr<IPC::Message> response_deleter(response); |
| 661 return succeeded; | 653 return succeeded; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 | 831 |
| 840 IPC::Message* response; | 832 IPC::Message* response; |
| 841 bool succeeded = sender_->SendAndWaitForResponse( | 833 bool succeeded = sender_->SendAndWaitForResponse( |
| 842 new AutomationMsg_OverrideEncodingRequest(0, handle_, encoding), | 834 new AutomationMsg_OverrideEncodingRequest(0, handle_, encoding), |
| 843 &response, AutomationMsg_OverrideEncodingResponse::ID) && | 835 &response, AutomationMsg_OverrideEncodingResponse::ID) && |
| 844 AutomationMsg_OverrideEncodingResponse::Read(response, &succeeded) && | 836 AutomationMsg_OverrideEncodingResponse::Read(response, &succeeded) && |
| 845 succeeded; | 837 succeeded; |
| 846 scoped_ptr<IPC::Message> response_deleter(response); | 838 scoped_ptr<IPC::Message> response_deleter(response); |
| 847 return succeeded; | 839 return succeeded; |
| 848 } | 840 } |
| OLD | NEW |