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

Unified Diff: chrome/browser/search_engines/template_url_service.cc

Issue 10698141: Revert 145993 - [Sync] Add location parameter to SyncChange in Sync API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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/search_engines/template_url_service.cc
===================================================================
--- chrome/browser/search_engines/template_url_service.cc (revision 145994)
+++ chrome/browser/search_engines/template_url_service.cc (working copy)
@@ -1106,8 +1106,7 @@
// preprocessing in TemplateURLService's loading code). Ignore it and send
// an ACTION_DELETE up to the server.
new_changes.push_back(
- syncer::SyncChange(FROM_HERE,
- syncer::SyncChange::ACTION_DELETE,
+ syncer::SyncChange(syncer::SyncChange::ACTION_DELETE,
iter->second));
continue;
}
@@ -1129,9 +1128,8 @@
// Otherwise, we know we have newer data, so update Sync with our
// data fields.
new_changes.push_back(
- syncer::SyncChange(FROM_HERE,
- syncer::SyncChange::ACTION_UPDATE,
- local_data_map[local_turl->sync_guid()]));
+ syncer::SyncChange(syncer::SyncChange::ACTION_UPDATE,
+ local_data_map[local_turl->sync_guid()]));
}
local_data_map.erase(iter->first);
} else {
@@ -1173,9 +1171,7 @@
for (SyncDataMap::const_iterator iter = local_data_map.begin();
iter != local_data_map.end(); ++iter) {
new_changes.push_back(
- syncer::SyncChange(FROM_HERE,
- syncer::SyncChange::ACTION_ADD,
- iter->second));
+ syncer::SyncChange(syncer::SyncChange::ACTION_ADD, iter->second));
}
// Do some post-processing on the change list to ensure that we are sending
@@ -1203,7 +1199,6 @@
}
void TemplateURLService::ProcessTemplateURLChange(
- const tracked_objects::Location& from_here,
const TemplateURL* turl,
syncer::SyncChange::SyncChangeType type) {
DCHECK_NE(type, syncer::SyncChange::ACTION_INVALID);
@@ -1228,9 +1223,7 @@
syncer::SyncChangeList changes;
syncer::SyncData sync_data = CreateSyncDataFromTemplateURL(*turl);
- changes.push_back(syncer::SyncChange(from_here,
- type,
- sync_data));
+ changes.push_back(syncer::SyncChange(type, sync_data));
sync_processor_->ProcessSyncChanges(FROM_HERE, changes);
}
@@ -1275,9 +1268,7 @@
// delete this data off the server.
if (specifics.url().empty() || specifics.sync_guid().empty()) {
change_list->push_back(
- syncer::SyncChange(FROM_HERE,
- syncer::SyncChange::ACTION_DELETE,
- sync_data));
+ syncer::SyncChange(syncer::SyncChange::ACTION_DELETE, sync_data));
return NULL;
}
@@ -1320,9 +1311,7 @@
turl->ResetKeywordIfNecessary(true);
syncer::SyncData sync_data = CreateSyncDataFromTemplateURL(*turl);
change_list->push_back(
- syncer::SyncChange(FROM_HERE,
- syncer::SyncChange::ACTION_UPDATE,
- sync_data));
+ syncer::SyncChange(syncer::SyncChange::ACTION_UPDATE, sync_data));
} else if (turl->IsGoogleSearchURLWithReplaceableKeyword()) {
if (!existing_turl) {
// We're adding a new TemplateURL that uses the Google base URL, so set
@@ -1778,9 +1767,7 @@
service_->UpdateKeyword(existing_turl->data());
// Inform sync of the update.
- ProcessTemplateURLChange(FROM_HERE,
- existing_turl,
- syncer::SyncChange::ACTION_UPDATE);
+ ProcessTemplateURLChange(existing_turl, syncer::SyncChange::ACTION_UPDATE);
if (default_search_provider_ == existing_turl) {
bool success = SetDefaultSearchProviderNoNotify(existing_turl);
@@ -2111,9 +2098,7 @@
// Inform sync the change to the show_in_default_list flag.
if (url)
- ProcessTemplateURLChange(FROM_HERE,
- url,
- syncer::SyncChange::ACTION_UPDATE);
+ ProcessTemplateURLChange(url, syncer::SyncChange::ACTION_UPDATE);
return true;
}
@@ -2162,9 +2147,7 @@
// Inform sync of the addition. Note that this will assign a GUID to
// template_url and add it to the guid_to_template_map_.
- ProcessTemplateURLChange(FROM_HERE,
- template_url,
- syncer::SyncChange::ACTION_ADD);
+ ProcessTemplateURLChange(template_url, syncer::SyncChange::ACTION_ADD);
}
return true;
@@ -2194,9 +2177,7 @@
service_->RemoveKeyword(template_url->id());
// Inform sync of the deletion.
- ProcessTemplateURLChange(FROM_HERE,
- template_url,
- syncer::SyncChange::ACTION_DELETE);
+ ProcessTemplateURLChange(template_url, syncer::SyncChange::ACTION_DELETE);
if (profile_) {
content::Source<Profile> source(profile_);
@@ -2326,9 +2307,8 @@
const bool can_replace_local = CanReplace(local_turl);
if (CanReplace(sync_turl) && (local_is_better || !can_replace_local)) {
syncer::SyncData sync_data = CreateSyncDataFromTemplateURL(*sync_turl);
- change_list->push_back(syncer::SyncChange(FROM_HERE,
- syncer::SyncChange::ACTION_DELETE,
- sync_data));
+ change_list->push_back(
+ syncer::SyncChange(syncer::SyncChange::ACTION_DELETE, sync_data));
return false;
}
if (can_replace_local) {
@@ -2341,9 +2321,7 @@
// PruneSyncChanges() will prune out the ACTION_DELETE we create here.
syncer::SyncData sync_data = CreateSyncDataFromTemplateURL(*local_turl);
change_list->push_back(
- syncer::SyncChange(FROM_HERE,
- syncer::SyncChange::ACTION_DELETE,
- sync_data));
+ syncer::SyncChange(syncer::SyncChange::ACTION_DELETE, sync_data));
Remove(local_turl);
} else if (local_is_better) {
string16 new_keyword = UniquifyKeyword(*sync_turl, false);
@@ -2352,9 +2330,8 @@
// If we update the cloud TURL, we need to push an update back to sync
// informing it that something has changed.
syncer::SyncData sync_data = CreateSyncDataFromTemplateURL(*sync_turl);
- change_list->push_back(syncer::SyncChange(FROM_HERE,
- syncer::SyncChange::ACTION_UPDATE,
- sync_data));
+ change_list->push_back(
+ syncer::SyncChange(syncer::SyncChange::ACTION_UPDATE, sync_data));
} else {
string16 new_keyword = UniquifyKeyword(*local_turl, false);
TemplateURLData data(local_turl->data());
@@ -2372,9 +2349,8 @@
// caller will later generate; but in this case, PruneSyncChanges() will
// prune out the ACTION_UPDATE we create here.
syncer::SyncData sync_data = CreateSyncDataFromTemplateURL(*local_turl);
- change_list->push_back(syncer::SyncChange(FROM_HERE,
- syncer::SyncChange::ACTION_UPDATE,
- sync_data));
+ change_list->push_back(
+ syncer::SyncChange(syncer::SyncChange::ACTION_UPDATE, sync_data));
}
return true;
}
@@ -2408,9 +2384,8 @@
// See comments in ResolveSyncKeywordConflict() regarding generating an
// ACTION_DELETE manually since Remove() won't do it.
syncer::SyncData sync_data = CreateSyncDataFromTemplateURL(*local_turl);
- change_list->push_back(syncer::SyncChange(FROM_HERE,
- syncer::SyncChange::ACTION_DELETE,
- sync_data));
+ change_list->push_back(
+ syncer::SyncChange(syncer::SyncChange::ACTION_DELETE, sync_data));
Remove(local_turl);
// Force the local ID to kInvalidTemplateURLID so we can add it.
@@ -2425,9 +2400,8 @@
// having the same GUID.
ResetTemplateURLGUID(local_turl, sync_turl->sync_guid());
syncer::SyncData sync_data = CreateSyncDataFromTemplateURL(*local_turl);
- change_list->push_back(syncer::SyncChange(FROM_HERE,
- syncer::SyncChange::ACTION_UPDATE,
- sync_data));
+ change_list->push_back(
+ syncer::SyncChange(syncer::SyncChange::ACTION_UPDATE, sync_data));
}
}

Powered by Google App Engine
This is Rietveld 408576698