| 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 | 648 |
| 649 bool TabProxy::GetPageCurrentEncoding(std::string* encoding) { | 649 bool TabProxy::GetPageCurrentEncoding(std::string* encoding) { |
| 650 if (!is_valid()) | 650 if (!is_valid()) |
| 651 return false; | 651 return false; |
| 652 | 652 |
| 653 bool succeeded = sender_->Send( | 653 bool succeeded = sender_->Send( |
| 654 new AutomationMsg_GetPageCurrentEncoding(0, handle_, encoding)); | 654 new AutomationMsg_GetPageCurrentEncoding(0, handle_, encoding)); |
| 655 return succeeded; | 655 return succeeded; |
| 656 } | 656 } |
| 657 | 657 |
| 658 bool TabProxy::ToggleEncodingAutoDetect() { |
| 659 if (!is_valid()) |
| 660 return false; |
| 661 |
| 662 bool succeeded = false; |
| 663 sender_->Send(new AutomationMsg_ToggleEncodingAutoDetect(0, handle_, |
| 664 &succeeded)); |
| 665 return succeeded; |
| 666 } |
| 667 |
| 658 bool TabProxy::OverrideEncoding(const std::string& encoding) { | 668 bool TabProxy::OverrideEncoding(const std::string& encoding) { |
| 659 if (!is_valid()) | 669 if (!is_valid()) |
| 660 return false; | 670 return false; |
| 661 | 671 |
| 662 bool succeeded = false; | 672 bool succeeded = false; |
| 663 sender_->Send(new AutomationMsg_OverrideEncoding(0, handle_, encoding, | 673 sender_->Send(new AutomationMsg_OverrideEncoding(0, handle_, encoding, |
| 664 &succeeded)); | 674 &succeeded)); |
| 665 return succeeded; | 675 return succeeded; |
| 666 } | 676 } |
| 667 | 677 |
| 668 #if defined(OS_WIN) | 678 #if defined(OS_WIN) |
| 669 void TabProxy::Reposition(HWND window, HWND window_insert_after, int left, | 679 void TabProxy::Reposition(HWND window, HWND window_insert_after, int left, |
| 670 int top, int width, int height, int flags, | 680 int top, int width, int height, int flags, |
| 671 HWND parent_window) { | 681 HWND parent_window) { |
| 672 | |
| 673 IPC::Reposition_Params params = {0}; | 682 IPC::Reposition_Params params = {0}; |
| 674 params.window = window; | 683 params.window = window; |
| 675 params.window_insert_after = window_insert_after; | 684 params.window_insert_after = window_insert_after; |
| 676 params.left = left; | 685 params.left = left; |
| 677 params.top = top; | 686 params.top = top; |
| 678 params.width = width; | 687 params.width = width; |
| 679 params.height = height; | 688 params.height = height; |
| 680 params.flags = flags; | 689 params.flags = flags; |
| 681 params.set_parent = (::IsWindow(parent_window) ? true : false); | 690 params.set_parent = (::IsWindow(parent_window) ? true : false); |
| 682 params.parent_window = parent_window; | 691 params.parent_window = parent_window; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 AutoLock lock(list_lock_); | 731 AutoLock lock(list_lock_); |
| 723 observers_list_.RemoveObserver(observer); | 732 observers_list_.RemoveObserver(observer); |
| 724 } | 733 } |
| 725 | 734 |
| 726 // Called on Channel background thread, if TabMessages filter is installed. | 735 // Called on Channel background thread, if TabMessages filter is installed. |
| 727 void TabProxy::OnMessageReceived(const IPC::Message& message) { | 736 void TabProxy::OnMessageReceived(const IPC::Message& message) { |
| 728 AutoLock lock(list_lock_); | 737 AutoLock lock(list_lock_); |
| 729 FOR_EACH_OBSERVER(TabProxyDelegate, observers_list_, | 738 FOR_EACH_OBSERVER(TabProxyDelegate, observers_list_, |
| 730 OnMessageReceived(this, message)); | 739 OnMessageReceived(this, message)); |
| 731 } | 740 } |
| OLD | NEW |