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

Unified Diff: chrome/browser/ui/webui/history_ui.cc

Issue 10031028: Single URL Expires Were Not Being Deleted. (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/ui/webui/history_ui.cc
===================================================================
--- chrome/browser/ui/webui/history_ui.cc (revision 132078)
+++ chrome/browser/ui/webui/history_ui.cc (working copy)
@@ -429,6 +429,20 @@
return options;
}
+// Helper function for Observe that determines if there are any differences
+// between the URLs noticed for deletion and the ones we are expecting.
+static bool DeletionsDiffer(const history::URLRows& deleted_rows,
+ const std::set<GURL>& urls_to_be_deleted) {
+ if (deleted_rows.size() != urls_to_be_deleted.size())
+ return true;
+ for (history::URLRows::const_iterator i = deleted_rows.begin();
+ i != deleted_rows.end(); ++i) {
+ if (urls_to_be_deleted.find(i->url()) == urls_to_be_deleted.end())
+ return true;
+ }
+ return false;
+}
+
void BrowsingHistoryHandler::Observe(
int type,
const content::NotificationSource& source,
@@ -439,11 +453,9 @@
}
history::URLsDeletedDetails* deletedDetails =
content::Details<history::URLsDeletedDetails>(details).ptr();
- if (deletedDetails->urls != urls_to_be_deleted_ ||
- deletedDetails->all_history) {
- // Notify the page that someone else deleted from the history.
+ if (deletedDetails->all_history ||
+ DeletionsDiffer(deletedDetails->rows, urls_to_be_deleted_))
web_ui()->CallJavascriptFunction("historyDeleted");
- }
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « chrome/browser/sync/profile_sync_service_typed_url_unittest.cc ('k') | chrome/browser/visitedlink/visitedlink_master.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698