Index: chrome/browser/history/history_backend.cc |
=================================================================== |
--- chrome/browser/history/history_backend.cc (revision 131423) |
+++ chrome/browser/history/history_backend.cc (working copy) |
@@ -845,7 +845,7 @@ |
// |
// TODO(brettw) bug 1140015: Add an "add page" notification so the history |
// views can keep in sync. |
- BroadcastNotifications(chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED, |
+ BroadcastNotifications(chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, |
modified.release()); |
ScheduleCommit(); |
@@ -879,7 +879,6 @@ |
redirects = &dummy_list; |
} |
- bool typed_url_changed = false; |
URLRows changed_urls; |
Peter Kasting
2012/04/10 02:18:57
Nit: You can save copying the whole URLRows object
mrossetti
2012/04/11 19:38:55
Sweet!
On 2012/04/10 02:18:57, Peter Kasting wrot
|
for (size_t i = 0; i < redirects->size(); i++) { |
URLRow row; |
@@ -887,25 +886,17 @@ |
if (row_id && row.title() != title) { |
row.set_title(title); |
db_->UpdateURLRow(row_id, row); |
+ row.set_id(row_id); |
sky
2012/04/10 16:29:01
Doesn't GetRowForURL set the id?
mrossetti
2012/04/11 19:38:55
Yes. Removed.
On 2012/04/10 16:29:01, sky wrote:
|
changed_urls.push_back(row); |
- if (row.typed_count() > 0) |
- typed_url_changed = true; |
} |
} |
- // Broadcast notifications for typed URLs that have changed. This will |
- // update the in-memory database. |
- // |
- // TODO(brettw) bug 1140020: Broadcast for all changes (not just typed), |
- // in which case some logic can be removed. |
- if (typed_url_changed) { |
- URLsModifiedDetails* modified = |
- new URLsModifiedDetails; |
- for (size_t i = 0; i < changed_urls.size(); i++) { |
- if (changed_urls[i].typed_count() > 0) |
- modified->changed_urls.push_back(changed_urls[i]); |
- } |
- BroadcastNotifications(chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED, |
+ // Broadcast notifications for any URLs that have changed. This will |
+ // update the in-memory database and the InMemoryURLIndex. |
+ if (!changed_urls.empty()) { |
+ URLsModifiedDetails* modified = new URLsModifiedDetails; |
+ modified->changed_urls = changed_urls; |
+ BroadcastNotifications(chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, |
modified); |
} |