Chromium Code Reviews| Index: chrome/browser/history/in_memory_history_backend.cc |
| =================================================================== |
| --- chrome/browser/history/in_memory_history_backend.cc (revision 131423) |
| +++ 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; |
| @@ -113,11 +113,13 @@ |
| URLRows::const_iterator i; |
| for (i = details.changed_urls.begin(); |
| i != details.changed_urls.end(); i++) { |
|
sky
2012/04/10 16:29:01
++i
mrossetti
2012/04/11 19:38:55
Done.
|
| - URLID id = db_->GetRowForURL(i->url(), NULL); |
| - if (id) |
| - db_->UpdateURLRow(id, *i); |
| - else |
| - id = db_->AddURL(*i); |
| + if (i->typed_count() > 0) { |
| + URLID id = db_->GetRowForURL(i->url(), NULL); |
| + if (id) |
| + db_->UpdateURLRow(id, *i); |
| + else |
| + db_->AddURL(*i); |
| + } |
| } |
| } |