diff options
Diffstat (limited to 'chrome/browser/importer/profile_writer.cc')
-rw-r--r-- | chrome/browser/importer/profile_writer.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc index bf81c3bc..ee478a0 100644 --- a/chrome/browser/importer/profile_writer.cc +++ b/chrome/browser/importer/profile_writer.cc @@ -255,15 +255,13 @@ static std::string HostPathKeyForURL(const GURL& url) { // the TemplateURL is invalid. static std::string BuildHostPathKey(const TemplateURL* t_url, bool try_url_if_invalid) { - if (!t_url->url().empty()) { - if (try_url_if_invalid && !t_url->url_ref().IsValid()) - return HostPathKeyForURL(GURL(t_url->url())); - - if (t_url->url_ref().SupportsReplacement()) { - return HostPathKeyForURL(GURL( - t_url->url_ref().ReplaceSearchTerms(ASCIIToUTF16("x"), - TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()))); - } + if (try_url_if_invalid && !t_url->url_ref().IsValid()) + return HostPathKeyForURL(GURL(t_url->url())); + + if (t_url->url_ref().SupportsReplacement()) { + return HostPathKeyForURL(GURL( + t_url->url_ref().ReplaceSearchTerms(ASCIIToUTF16("x"), + TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()))); } return std::string(); } @@ -317,7 +315,7 @@ void ProfileWriter::AddKeywords(ScopedVector<TemplateURL> template_urls, continue; // Only add valid TemplateURLs to the model. - if (!(*i)->url().empty() && (*i)->url_ref().IsValid()) { + if ((*i)->url_ref().IsValid()) { model->Add(*i); // Takes ownership. *i = NULL; // Prevent the vector from deleting *i later. } |