| 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 24 matching lines...) Expand all Loading... |
| 35 return false; | 35 return false; |
| 36 | 36 |
| 37 if (!index) { | 37 if (!index) { |
| 38 NOTREACHED(); | 38 NOTREACHED(); |
| 39 return false; | 39 return false; |
| 40 } | 40 } |
| 41 | 41 |
| 42 return sender_->Send(new AutomationMsg_TabIndex(0, handle_, index)); | 42 return sender_->Send(new AutomationMsg_TabIndex(0, handle_, index)); |
| 43 } | 43 } |
| 44 | 44 |
| 45 bool TabProxy::IsShelfVisible(bool* is_visible) { | |
| 46 if (!is_valid()) | |
| 47 return false; | |
| 48 | |
| 49 if (!is_visible) { | |
| 50 NOTREACHED(); | |
| 51 return false; | |
| 52 } | |
| 53 | |
| 54 return sender_->Send(new AutomationMsg_ShelfVisibility(0, handle_, | |
| 55 is_visible)); | |
| 56 } | |
| 57 | |
| 58 int TabProxy::FindInPage(const std::wstring& search_string, | 45 int TabProxy::FindInPage(const std::wstring& search_string, |
| 59 FindInPageDirection forward, | 46 FindInPageDirection forward, |
| 60 FindInPageCase match_case, | 47 FindInPageCase match_case, |
| 61 bool find_next, | 48 bool find_next, |
| 62 int* ordinal) { | 49 int* ordinal) { |
| 63 if (!is_valid()) | 50 if (!is_valid()) |
| 64 return -1; | 51 return -1; |
| 65 | 52 |
| 66 AutomationMsg_Find_Params params; | 53 AutomationMsg_Find_Params params; |
| 67 params.unused = 0; | 54 params.unused = 0; |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 scoped_refptr<ConstrainedWindowProxy> TabProxy::GetConstrainedWindow( | 327 scoped_refptr<ConstrainedWindowProxy> TabProxy::GetConstrainedWindow( |
| 341 int window_index) const { | 328 int window_index) const { |
| 342 if (!is_valid()) | 329 if (!is_valid()) |
| 343 return NULL; | 330 return NULL; |
| 344 | 331 |
| 345 int handle = 0; | 332 int handle = 0; |
| 346 if (!sender_->Send(new AutomationMsg_ConstrainedWindow(0, handle_, | 333 if (!sender_->Send(new AutomationMsg_ConstrainedWindow(0, handle_, |
| 347 window_index, | 334 window_index, |
| 348 &handle))) | 335 &handle))) |
| 349 return NULL; | 336 return NULL; |
| 350 | 337 |
| 351 if (handle == 0) | 338 if (handle == 0) |
| 352 return NULL; | 339 return NULL; |
| 353 | 340 |
| 354 ConstrainedWindowProxy* w = static_cast<ConstrainedWindowProxy*>( | 341 ConstrainedWindowProxy* w = static_cast<ConstrainedWindowProxy*>( |
| 355 tracker_->GetResource(handle)); | 342 tracker_->GetResource(handle)); |
| 356 if (!w) { | 343 if (!w) { |
| 357 w = new ConstrainedWindowProxy(sender_, tracker_, handle); | 344 w = new ConstrainedWindowProxy(sender_, tracker_, handle); |
| 358 w->AddRef(); | 345 w->AddRef(); |
| 359 } | 346 } |
| 360 | 347 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 AutoLock lock(list_lock_); | 673 AutoLock lock(list_lock_); |
| 687 observers_list_.RemoveObserver(observer); | 674 observers_list_.RemoveObserver(observer); |
| 688 } | 675 } |
| 689 | 676 |
| 690 // Called on Channel background thread, if TabMessages filter is installed. | 677 // Called on Channel background thread, if TabMessages filter is installed. |
| 691 void TabProxy::OnMessageReceived(const IPC::Message& message) { | 678 void TabProxy::OnMessageReceived(const IPC::Message& message) { |
| 692 AutoLock lock(list_lock_); | 679 AutoLock lock(list_lock_); |
| 693 FOR_EACH_OBSERVER(TabProxyDelegate, observers_list_, | 680 FOR_EACH_OBSERVER(TabProxyDelegate, observers_list_, |
| 694 OnMessageReceived(this, message)); | 681 OnMessageReceived(this, message)); |
| 695 } | 682 } |
| OLD | NEW |