Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2194)

Unified Diff: chrome/browser/importer/profile_writer.cc

Issue 9968016: Move the URL string from TemplateURLRef onto the owning TemplateURL. This will make it easier to m… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/importer/profile_writer.cc
===================================================================
--- chrome/browser/importer/profile_writer.cc (revision 130285)
+++ chrome/browser/importer/profile_writer.cc (working copy)
@@ -255,13 +255,13 @@
// the TemplateURL is invalid.
static std::string BuildHostPathKey(const TemplateURL* t_url,
bool try_url_if_invalid) {
- if (t_url->url()) {
- if (try_url_if_invalid && !t_url->url()->IsValid())
- return HostPathKeyForURL(GURL(t_url->url()->url()));
+ 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()->SupportsReplacement()) {
+ if (t_url->url_ref().SupportsReplacement()) {
return HostPathKeyForURL(GURL(
- t_url->url()->ReplaceSearchTerms(ASCIIToUTF16("x"),
+ t_url->url_ref().ReplaceSearchTerms(ASCIIToUTF16("x"),
TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16())));
}
}
@@ -317,7 +317,7 @@
continue;
// Only add valid TemplateURLs to the model.
- if ((*i)->url() && (*i)->url()->IsValid()) {
+ if (!(*i)->url().empty() && (*i)->url_ref().IsValid()) {
model->Add(*i); // Takes ownership.
*i = NULL; // Prevent the vector from deleting *i later.
}
« no previous file with comments | « chrome/browser/importer/profile_import_process_messages.h ('k') | chrome/browser/instant/instant_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698