| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1240 | 1240 |
| 1241 void TestingAutomationProvider::AutocompleteEditGetMatches( | 1241 void TestingAutomationProvider::AutocompleteEditGetMatches( |
| 1242 int autocomplete_edit_handle, | 1242 int autocomplete_edit_handle, |
| 1243 bool* success, | 1243 bool* success, |
| 1244 std::vector<AutocompleteMatchData>* matches) { | 1244 std::vector<AutocompleteMatchData>* matches) { |
| 1245 *success = false; | 1245 *success = false; |
| 1246 if (automation_omnibox_tracker_->ContainsHandle(autocomplete_edit_handle)) { | 1246 if (automation_omnibox_tracker_->ContainsHandle(autocomplete_edit_handle)) { |
| 1247 const AutocompleteResult& result = automation_omnibox_tracker_-> | 1247 const AutocompleteResult& result = automation_omnibox_tracker_-> |
| 1248 GetResource(autocomplete_edit_handle)->model()->result(); | 1248 GetResource(autocomplete_edit_handle)->model()->result(); |
| 1249 for (AutocompleteResult::const_iterator i = result.begin(); | 1249 for (AutocompleteResult::const_iterator i = result.begin(); |
| 1250 i != result.end(); ++i) | 1250 i != result.end(); ++i) { |
| 1251 matches->push_back(AutocompleteMatchData(*i)); | 1251 AutocompleteMatch match(*i); |
| 1252 AutocompleteMatchData match_data; |
| 1253 match_data.provider_name = match.provider->name(); |
| 1254 match_data.relevance = match.relevance; |
| 1255 match_data.deletable = match.deletable; |
| 1256 match_data.fill_into_edit = match.fill_into_edit; |
| 1257 match_data.inline_autocomplete_offset = match.inline_autocomplete_offset; |
| 1258 match_data.destination_url = match.destination_url; |
| 1259 match_data.contents = match.contents; |
| 1260 match_data.description = match.description; |
| 1261 match_data.is_history_what_you_typed_match = |
| 1262 match.is_history_what_you_typed_match; |
| 1263 match_data.type = AutocompleteMatch::TypeToString(match.type); |
| 1264 match_data.starred = match.starred; |
| 1265 matches->push_back(match_data); |
| 1266 } |
| 1252 *success = true; | 1267 *success = true; |
| 1253 } | 1268 } |
| 1254 } | 1269 } |
| 1255 | 1270 |
| 1256 // Waits for the autocomplete edit to receive focus | 1271 // Waits for the autocomplete edit to receive focus |
| 1257 void TestingAutomationProvider::WaitForAutocompleteEditFocus( | 1272 void TestingAutomationProvider::WaitForAutocompleteEditFocus( |
| 1258 int autocomplete_edit_handle, | 1273 int autocomplete_edit_handle, |
| 1259 IPC::Message* reply_message) { | 1274 IPC::Message* reply_message) { |
| 1260 if (!automation_omnibox_tracker_->ContainsHandle(autocomplete_edit_handle)) { | 1275 if (!automation_omnibox_tracker_->ContainsHandle(autocomplete_edit_handle)) { |
| 1261 AutomationMsg_WaitForAutocompleteEditFocus::WriteReplyParams( | 1276 AutomationMsg_WaitForAutocompleteEditFocus::WriteReplyParams( |
| (...skipping 4703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5965 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 5980 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
| 5966 | 5981 |
| 5967 Send(reply_message_); | 5982 Send(reply_message_); |
| 5968 redirect_query_ = 0; | 5983 redirect_query_ = 0; |
| 5969 reply_message_ = NULL; | 5984 reply_message_ = NULL; |
| 5970 } | 5985 } |
| 5971 | 5986 |
| 5972 void TestingAutomationProvider::OnRemoveProvider() { | 5987 void TestingAutomationProvider::OnRemoveProvider() { |
| 5973 AutomationProviderList::GetInstance()->RemoveProvider(this); | 5988 AutomationProviderList::GetInstance()->RemoveProvider(this); |
| 5974 } | 5989 } |
| OLD | NEW |