Chromium Code Reviews| Index: chrome/browser/autocomplete/search_provider.cc |
| diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc |
| index 1dae40ae5d5098687437d25b642c85016083bb07..367c6ef6b39e9c0b9492cc482be5eb1a571e3aad 100644 |
| --- a/chrome/browser/autocomplete/search_provider.cc |
| +++ b/chrome/browser/autocomplete/search_provider.cc |
| @@ -452,9 +452,9 @@ bool SearchProvider::ParseSuggestResults(Value* root_val, |
| bool is_keyword, |
| const string16& input_text, |
| SuggestResults* suggest_results) { |
| - if (!root_val->IsType(Value::TYPE_LIST)) |
| + ListValue* root_list = root_val->AsList(); |
| + if (!root_list) |
| return false; |
| - ListValue* root_list = static_cast<ListValue*>(root_val); |
| Value* query_val; |
| string16 query_str; |
| @@ -462,15 +462,14 @@ bool SearchProvider::ParseSuggestResults(Value* root_val, |
| if ((root_list->GetSize() < 2) || !root_list->Get(0, &query_val) || |
| !query_val->GetAsString(&query_str) || |
| (query_str != input_text) || |
| - !root_list->Get(1, &result_val) || !result_val->IsType(Value::TYPE_LIST)) |
| + !root_list->Get(1, &result_val) || !result_val->AsList()) |
| return false; |
| ListValue* description_list = NULL; |
| if (root_list->GetSize() > 2) { |
| // 3rd element: Description list. |
| Value* description_val; |
| - if (root_list->Get(2, &description_val) && |
| - description_val->IsType(Value::TYPE_LIST)) |
| + if (root_list->Get(2, &description_val) && description_val->AsList()) |
| description_list = static_cast<ListValue*>(description_val); |
|
Evan Martin
2011/08/23 18:15:26
if (root_list->Get(2, &description_val))
descrip
tfarina
2011/08/23 18:26:36
Done.
|
| } |