| Index: chrome/browser/autocomplete/search_provider.cc
|
| ===================================================================
|
| --- chrome/browser/autocomplete/search_provider.cc (revision 7711)
|
| +++ chrome/browser/autocomplete/search_provider.cc (working copy)
|
| @@ -10,6 +10,7 @@
|
| #include "chrome/browser/google_util.h"
|
| #include "chrome/browser/profile.h"
|
| #include "chrome/browser/template_url_model.h"
|
| +#include "chrome/browser/url_fixer_upper.h"
|
| #include "chrome/common/json_value_serializer.h"
|
| #include "chrome/common/l10n_util.h"
|
| #include "chrome/common/pref_names.h"
|
| @@ -321,8 +322,15 @@
|
| description_list && description_list->Get(i, &site_val) &&
|
| site_val->IsType(Value::TYPE_STRING) &&
|
| site_val->GetAsString(&site_name)) {
|
| - navigation_results_.push_back(NavigationResult(GURL(suggestion_str),
|
| - site_name));
|
| + // Navigation links might not be valid URLs. For example, the Google
|
| + // suggest server returns navigation links without a scheme if the
|
| + // scheme is http. Fix the URL, and verify that it's valid before
|
| + // adding it to the list.
|
| + GURL result_url = GURL(URLFixerUpper::FixupURL(suggestion_str, L""));
|
| + if (result_url.is_valid()) {
|
| + navigation_results_.push_back(NavigationResult(result_url,
|
| + site_name));
|
| + }
|
| }
|
| } else {
|
| // TODO(kochi): Currently we treat a calculator result as a query, but it
|
|
|