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

Unified Diff: chrome/browser/sync/glue/typed_url_change_processor.cc

Issue 9852002: Have URL Modifications sent Regardless of Typed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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/sync/glue/typed_url_change_processor.cc
===================================================================
--- chrome/browser/sync/glue/typed_url_change_processor.cc (revision 131849)
+++ chrome/browser/sync/glue/typed_url_change_processor.cc (working copy)
@@ -68,16 +68,14 @@
DVLOG(1) << "Observed typed_url change.";
DCHECK(running());
- DCHECK(chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED == type ||
- chrome::NOTIFICATION_HISTORY_URLS_DELETED == type ||
- chrome::NOTIFICATION_HISTORY_URL_VISITED == type);
- if (type == chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED) {
+ if (type == chrome::NOTIFICATION_HISTORY_URLS_MODIFIED) {
HandleURLsModified(
content::Details<history::URLsModifiedDetails>(details).ptr());
} else if (type == chrome::NOTIFICATION_HISTORY_URLS_DELETED) {
HandleURLsDeleted(
content::Details<history::URLsDeletedDetails>(details).ptr());
- } else if (type == chrome::NOTIFICATION_HISTORY_URL_VISITED) {
+ } else {
+ DCHECK_EQ(chrome::NOTIFICATION_HISTORY_URL_VISITED, type);
HandleURLsVisited(
content::Details<history::URLVisitedDetails>(details).ptr());
}
@@ -89,9 +87,11 @@
sync_api::WriteTransaction trans(FROM_HERE, share_handle());
for (history::URLRows::iterator url = details->changed_urls.begin();
url != details->changed_urls.end(); ++url) {
- // Exit if we were unable to update the sync node.
- if (!CreateOrUpdateSyncNode(*url, &trans))
- return;
+ if (url->typed_count() > 0) {
+ // Exit if we were unable to update the sync node.
+ if (!CreateOrUpdateSyncNode(*url, &trans))
+ return;
+ }
}
}
@@ -300,7 +300,7 @@
DCHECK(expected_loop_ == MessageLoop::current());
DCHECK(profile_);
notification_registrar_.Add(
- this, chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED,
+ this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED,
content::Source<Profile>(profile_));
notification_registrar_.Add(
this, chrome::NOTIFICATION_HISTORY_URLS_DELETED,
@@ -314,7 +314,7 @@
DCHECK(expected_loop_ == MessageLoop::current());
DCHECK(profile_);
notification_registrar_.Remove(
- this, chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED,
+ this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED,
content::Source<Profile>(profile_));
notification_registrar_.Remove(
this, chrome::NOTIFICATION_HISTORY_URLS_DELETED,
« no previous file with comments | « chrome/browser/history/in_memory_url_index.cc ('k') | chrome/browser/sync/profile_sync_service_typed_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698