| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/autocomplete_edit_proxy.h" | 5 #include "chrome/test/automation/autocomplete_edit_proxy.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
| 10 #include "chrome/common/automation_constants.h" | 10 #include "chrome/common/automation_constants.h" |
| 11 #include "chrome/common/automation_messages.h" | 11 #include "chrome/common/automation_messages.h" |
| 12 #include "chrome/test/automation/automation_proxy.h" | 12 #include "chrome/test/automation/automation_proxy.h" |
| 13 | 13 |
| 14 using base::TimeDelta; | 14 using base::TimeDelta; |
| 15 using base::TimeTicks; | 15 using base::TimeTicks; |
| 16 | 16 |
| 17 bool AutocompleteEditProxy::GetText(std::wstring* text) const { | 17 bool AutocompleteEditProxy::GetText(string16* text) const { |
| 18 if (!is_valid()) | 18 if (!is_valid()) |
| 19 return false; | 19 return false; |
| 20 if (!text) { | 20 if (!text) { |
| 21 NOTREACHED(); | 21 NOTREACHED(); |
| 22 return false; | 22 return false; |
| 23 } | 23 } |
| 24 bool result = false; | 24 bool result = false; |
| 25 sender_->Send(new AutomationMsg_AutocompleteEditGetText( | 25 sender_->Send(new AutomationMsg_AutocompleteEditGetText( |
| 26 handle_, &result, text)); | 26 handle_, &result, text)); |
| 27 return result; | 27 return result; |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool AutocompleteEditProxy::WaitForFocus() const { | 30 bool AutocompleteEditProxy::WaitForFocus() const { |
| 31 if (!is_valid()) | 31 if (!is_valid()) |
| 32 return false; | 32 return false; |
| 33 bool edit_exists = false; | 33 bool edit_exists = false; |
| 34 sender_->Send(new AutomationMsg_WaitForAutocompleteEditFocus( | 34 sender_->Send(new AutomationMsg_WaitForAutocompleteEditFocus( |
| 35 handle_, &edit_exists)); | 35 handle_, &edit_exists)); |
| 36 return edit_exists; | 36 return edit_exists; |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool AutocompleteEditProxy::SetText(const std::wstring& text) { | 39 bool AutocompleteEditProxy::SetText(const string16& text) { |
| 40 if (!is_valid()) | 40 if (!is_valid()) |
| 41 return false; | 41 return false; |
| 42 bool result = false; | 42 bool result = false; |
| 43 sender_->Send(new AutomationMsg_AutocompleteEditSetText( | 43 sender_->Send(new AutomationMsg_AutocompleteEditSetText( |
| 44 handle_, text, &result)); | 44 handle_, text, &result)); |
| 45 return result; | 45 return result; |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool AutocompleteEditProxy::IsQueryInProgress(bool* query_in_progress) const { | 48 bool AutocompleteEditProxy::IsQueryInProgress(bool* query_in_progress) const { |
| 49 if (!is_valid()) | 49 if (!is_valid()) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 78 return false; | 78 return false; |
| 79 if (!matches) { | 79 if (!matches) { |
| 80 NOTREACHED(); | 80 NOTREACHED(); |
| 81 return false; | 81 return false; |
| 82 } | 82 } |
| 83 bool edit_exists = false; | 83 bool edit_exists = false; |
| 84 sender_->Send(new AutomationMsg_AutocompleteEditGetMatches( | 84 sender_->Send(new AutomationMsg_AutocompleteEditGetMatches( |
| 85 handle_, &edit_exists, matches)); | 85 handle_, &edit_exists, matches)); |
| 86 return edit_exists; | 86 return edit_exists; |
| 87 } | 87 } |
| OLD | NEW |