| 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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 | 638 |
| 639 AutomationMsg_NavigationResponseValues result = | 639 AutomationMsg_NavigationResponseValues result = |
| 640 AUTOMATION_MSG_NAVIGATION_ERROR; | 640 AUTOMATION_MSG_NAVIGATION_ERROR; |
| 641 sender_->Send(new AutomationMsg_WaitForNavigation(0, handle_, | 641 sender_->Send(new AutomationMsg_WaitForNavigation(0, handle_, |
| 642 last_navigation_time, | 642 last_navigation_time, |
| 643 &result)); | 643 &result)); |
| 644 return result == AUTOMATION_MSG_NAVIGATION_SUCCESS || | 644 return result == AUTOMATION_MSG_NAVIGATION_SUCCESS || |
| 645 result == AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED; | 645 result == AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED; |
| 646 } | 646 } |
| 647 | 647 |
| 648 bool TabProxy::GetPageCurrentEncoding(std::wstring* encoding) { | 648 bool TabProxy::GetPageCurrentEncoding(std::string* encoding) { |
| 649 if (!is_valid()) | 649 if (!is_valid()) |
| 650 return false; | 650 return false; |
| 651 | 651 |
| 652 bool succeeded = sender_->Send( | 652 bool succeeded = sender_->Send( |
| 653 new AutomationMsg_GetPageCurrentEncoding(0, handle_, encoding)); | 653 new AutomationMsg_GetPageCurrentEncoding(0, handle_, encoding)); |
| 654 return succeeded; | 654 return succeeded; |
| 655 } | 655 } |
| 656 | 656 |
| 657 bool TabProxy::OverrideEncoding(const std::wstring& encoding) { | 657 bool TabProxy::OverrideEncoding(const std::string& encoding) { |
| 658 if (!is_valid()) | 658 if (!is_valid()) |
| 659 return false; | 659 return false; |
| 660 | 660 |
| 661 bool succeeded = false; | 661 bool succeeded = false; |
| 662 sender_->Send(new AutomationMsg_OverrideEncoding(0, handle_, encoding, | 662 sender_->Send(new AutomationMsg_OverrideEncoding(0, handle_, encoding, |
| 663 &succeeded)); | 663 &succeeded)); |
| 664 return succeeded; | 664 return succeeded; |
| 665 } | 665 } |
| 666 | 666 |
| 667 #if defined(OS_WIN) | 667 #if defined(OS_WIN) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 AutoLock lock(list_lock_); | 722 AutoLock lock(list_lock_); |
| 723 observers_list_.RemoveObserver(observer); | 723 observers_list_.RemoveObserver(observer); |
| 724 } | 724 } |
| 725 | 725 |
| 726 // Called on Channel background thread, if TabMessages filter is installed. | 726 // Called on Channel background thread, if TabMessages filter is installed. |
| 727 void TabProxy::OnMessageReceived(const IPC::Message& message) { | 727 void TabProxy::OnMessageReceived(const IPC::Message& message) { |
| 728 AutoLock lock(list_lock_); | 728 AutoLock lock(list_lock_); |
| 729 FOR_EACH_OBSERVER(TabProxyDelegate, observers_list_, | 729 FOR_EACH_OBSERVER(TabProxyDelegate, observers_list_, |
| 730 OnMessageReceived(this, message)); | 730 OnMessageReceived(this, message)); |
| 731 } | 731 } |
| OLD | NEW |