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

Unified Diff: chrome/browser/importer/profile_import_process_messages.h

Issue 9965143: Revert 130431 - Move the URL string from TemplateURLRef onto the owning TemplateURL. This will mak… (Closed) Base URL: svn://svn.chromium.org/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
« no previous file with comments | « chrome/browser/importer/firefox_importer_utils.cc ('k') | chrome/browser/importer/profile_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/profile_import_process_messages.h
===================================================================
--- chrome/browser/importer/profile_import_process_messages.h (revision 130565)
+++ chrome/browser/importer/profile_import_process_messages.h (working copy)
@@ -199,9 +199,13 @@
typedef TemplateURL* param_type;
static void Write(Message* m, const param_type& p) {
WriteParam(m, p->short_name());
- WriteParam(m, p->url());
- WriteParam(m, p->suggestions_url());
- WriteParam(m, p->instant_url());
+ if (p->suggestions_url()) {
+ WriteParam(m, true);
+ WriteParam(m, p->suggestions_url()->url());
+ } else {
+ WriteParam(m, false);
+ }
+ WriteParam(m, p->url()->url());
WriteParam(m, p->originating_url());
WriteParam(m, p->keyword());
WriteParam(m, p->autogenerate_keyword());
@@ -215,10 +219,12 @@
WriteParam(m, p->prepopulate_id());
}
static bool Read(const Message* m, PickleIterator* iter, param_type* p) {
+ *p = NULL;
+
string16 short_name;
+ bool includes_suggestions_url;
+ std::string suggestions_url;
std::string url;
- std::string suggestions_url;
- std::string instant_url;
GURL originating_url;
string16 keyword;
bool autogenerate_keyword;
@@ -229,36 +235,47 @@
base::Time last_modified;
int usage_count;
int prepopulate_id;
- if (!ReadParam(m, iter, &short_name) ||
- !ReadParam(m, iter, &url) ||
- !ReadParam(m, iter, &suggestions_url) ||
- !ReadParam(m, iter, &instant_url) ||
+
+ if (!ReadParam(m, iter, &short_name))
+ return false;
+
+ if (!ReadParam(m, iter, &includes_suggestions_url))
+ return false;
+ if (includes_suggestions_url) {
+ if (!ReadParam(m, iter, &suggestions_url))
+ return false;
+ }
+
+ if (!ReadParam(m, iter, &url) ||
!ReadParam(m, iter, &originating_url) ||
!ReadParam(m, iter, &keyword) ||
!ReadParam(m, iter, &autogenerate_keyword) ||
!ReadParam(m, iter, &show_in_default_list) ||
- !ReadParam(m, iter, &safe_for_autoreplace) ||
- !ReadParam(m, iter, &favicon_url) ||
+ !ReadParam(m, iter, &safe_for_autoreplace))
+ return false;
+
+ scoped_ptr<TemplateURL> turl(new TemplateURL());
+ if (!ReadParam(m, iter, &favicon_url) ||
!ReadParam(m, iter, &date_created) ||
!ReadParam(m, iter, &last_modified) ||
!ReadParam(m, iter, &usage_count) ||
!ReadParam(m, iter, &prepopulate_id))
return false;
- *p = new TemplateURL();
- (*p)->set_short_name(short_name);
- (*p)->SetURL(url);
- (*p)->SetSuggestionsURL(suggestions_url);
- (*p)->SetInstantURL(suggestions_url);
- (*p)->set_originating_url(originating_url);
- (*p)->set_keyword(keyword);
- (*p)->set_autogenerate_keyword(autogenerate_keyword);
- (*p)->set_show_in_default_list(show_in_default_list);
- (*p)->set_safe_for_autoreplace(safe_for_autoreplace);
- (*p)->set_favicon_url(favicon_url);
- (*p)->set_date_created(date_created);
- (*p)->set_last_modified(last_modified);
- (*p)->set_usage_count(usage_count);
- (*p)->SetPrepopulateId(prepopulate_id);
+
+ turl->set_short_name(short_name);
+ turl->SetSuggestionsURL(suggestions_url);
+ turl->SetURL(url);
+ turl->set_originating_url(originating_url);
+ turl->set_keyword(keyword);
+ turl->set_autogenerate_keyword(autogenerate_keyword);
+ turl->set_show_in_default_list(show_in_default_list);
+ turl->set_safe_for_autoreplace(safe_for_autoreplace);
+ turl->set_favicon_url(favicon_url);
+ turl->set_date_created(date_created);
+ turl->set_last_modified(last_modified);
+ turl->set_usage_count(usage_count);
+ turl->SetPrepopulateId(prepopulate_id);
+ *p = turl.release();
return true;
}
static void Log(const param_type& p, std::string* l) {
« no previous file with comments | « chrome/browser/importer/firefox_importer_utils.cc ('k') | chrome/browser/importer/profile_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698