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

Unified Diff: chrome/browser/history/in_memory_history_backend.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
« no previous file with comments | « chrome/browser/history/history_backend.cc ('k') | chrome/browser/history/in_memory_url_index.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/in_memory_history_backend.cc
===================================================================
--- chrome/browser/history/in_memory_history_backend.cc (revision 131849)
+++ chrome/browser/history/in_memory_history_backend.cc (working copy)
@@ -51,7 +51,7 @@
// We only want notifications for the associated profile.
content::Source<Profile> source(profile_);
registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URL_VISITED, source);
- registrar_.Add(this, chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED,
+ registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED,
source);
registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, source);
registrar_.Add(this,
@@ -82,7 +82,7 @@
OnKeywordSearchTermUpdated(
*content::Details<history::KeywordSearchTermDetails>(details).ptr());
break;
- case chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED:
+ case chrome::NOTIFICATION_HISTORY_URLS_MODIFIED:
OnTypedURLsModified(
*content::Details<history::URLsModifiedDetails>(details).ptr());
break;
@@ -112,12 +112,14 @@
// have Sync(), which would take the ID if it's given and add it.
URLRows::const_iterator i;
for (i = details.changed_urls.begin();
- i != details.changed_urls.end(); i++) {
- URLID id = db_->GetRowForURL(i->url(), NULL);
- if (id)
- db_->UpdateURLRow(id, *i);
- else
- id = db_->AddURL(*i);
+ i != details.changed_urls.end(); ++i) {
+ if (i->typed_count() > 0) {
+ URLID id = db_->GetRowForURL(i->url(), NULL);
+ if (id)
+ db_->UpdateURLRow(id, *i);
+ else
+ db_->AddURL(*i);
+ }
}
}
« no previous file with comments | « chrome/browser/history/history_backend.cc ('k') | chrome/browser/history/in_memory_url_index.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698