| 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..ca3c7826d207070fa4b2e8cf5db211239c20c8c0 100644
|
| --- a/chrome/browser/autocomplete/search_provider.cc
|
| +++ b/chrome/browser/autocomplete/search_provider.cc
|
| @@ -18,11 +18,11 @@
|
| #include "chrome/browser/autocomplete/autocomplete_match.h"
|
| #include "chrome/browser/autocomplete/keyword_provider.h"
|
| #include "chrome/browser/history/history.h"
|
| +#include "chrome/browser/history/in_memory_database.h"
|
| #include "chrome/browser/instant/instant_controller.h"
|
| #include "chrome/browser/net/url_fixer_upper.h"
|
| #include "chrome/browser/prefs/pref_service.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| -#include "chrome/browser/history/in_memory_database.h"
|
| #include "chrome/browser/search_engines/template_url_service.h"
|
| #include "chrome/browser/search_engines/template_url_service_factory.h"
|
| #include "chrome/common/pref_names.h"
|
| @@ -452,7 +452,7 @@ bool SearchProvider::ParseSuggestResults(Value* root_val,
|
| bool is_keyword,
|
| const string16& input_text,
|
| SuggestResults* suggest_results) {
|
| - if (!root_val->IsType(Value::TYPE_LIST))
|
| + if (!root_val->IsList())
|
| return false;
|
| ListValue* root_list = static_cast<ListValue*>(root_val);
|
|
|
| @@ -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->IsList())
|
| 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->IsList())
|
| description_list = static_cast<ListValue*>(description_val);
|
| }
|
|
|
| @@ -484,8 +483,7 @@ bool SearchProvider::ParseSuggestResults(Value* root_val,
|
| // optional data are defined.
|
| if (root_list->GetSize() > 4) {
|
| Value* optional_val;
|
| - if (root_list->Get(4, &optional_val) &&
|
| - optional_val->IsType(Value::TYPE_DICTIONARY)) {
|
| + if (root_list->Get(4, &optional_val) && optional_val->IsDictionary()) {
|
| DictionaryValue* dict_val = static_cast<DictionaryValue*>(optional_val);
|
|
|
| // Parse Google Suggest specific type extension.
|
| @@ -520,8 +518,7 @@ bool SearchProvider::ParseSuggestResults(Value* root_val,
|
| default_navigation_results_;
|
| if ((navigation_results.size() < kMaxMatches) &&
|
| description_list && description_list->Get(i, &site_val) &&
|
| - site_val->IsType(Value::TYPE_STRING) &&
|
| - site_val->GetAsString(&site_name)) {
|
| + site_val->IsString() && site_val->GetAsString(&site_name)) {
|
| // We can't blindly trust the URL coming from the server to be valid.
|
| GURL result_url(URLFixerUpper::FixupURL(UTF16ToUTF8(suggestion_str),
|
| std::string()));
|
|
|