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

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 131423)
+++ chrome/browser/sync/glue/typed_url_change_processor.cc (working copy)
@@ -68,10 +68,10 @@
DVLOG(1) << "Observed typed_url change.";
DCHECK(running());
- DCHECK(chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED == type ||
+ DCHECK(chrome::NOTIFICATION_HISTORY_URLS_MODIFIED == type ||
Peter Kasting 2012/04/10 02:18:57 Nit: Slightly simpler: Remove this DCHECK, change
mrossetti 2012/04/11 19:38:55 Done.
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) {
@@ -89,9 +89,12 @@
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;
+ // Only consider typed URLs.
Peter Kasting 2012/04/10 02:18:57 Nit: This comment doesn't really add anything
mrossetti 2012/04/11 19:38:55 Done.
+ if (url->typed_count() > 0) {
+ // Exit if we were unable to update the sync node.
+ if (!CreateOrUpdateSyncNode(*url, &trans))
+ return;
+ }
}
}
@@ -296,7 +299,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,
@@ -310,7 +313,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,

Powered by Google App Engine
This is Rietveld 408576698