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

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

Issue 14225004: History: Reload page only after web history deletion has completed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: x Created 7 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
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc
index 1d0fe26549cf93346497429750bab119dea32193..0f89be83691638dba10167771c3844c457d0ad55 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -1059,15 +1059,18 @@ void BrowsingHistoryHandler::WebHistoryQueryComplete(
void BrowsingHistoryHandler::RemoveComplete() {
urls_to_be_deleted_.clear();
- // Notify the page that the deletion request succeeded.
- web_ui()->CallJavascriptFunction("deleteComplete");
+ // Notify the page that the deletion request is complete, but only if a web
+ // history delete request is not still pending.
+ if (!(web_history_request_.get() && web_history_request_->is_pending()))
+ web_ui()->CallJavascriptFunction("deleteComplete");
}
void BrowsingHistoryHandler::RemoveWebHistoryComplete(
history::WebHistoryService::Request* request, bool success) {
- // Notify the page that the deletion request is complete.
- base::FundamentalValue success_value(success);
- web_ui()->CallJavascriptFunction("webHistoryDeleteComplete", success_value);
+ // TODO(dubroy): Should we handle failure somehow? Delete directives will
+ // ensure that the visits are eventually deleted, so maybe it's not necessary.
+ if (!delete_task_tracker_.HasTrackedTasks())
+ RemoveComplete();
}
void BrowsingHistoryHandler::SetQueryTimeInWeeks(

Powered by Google App Engine
This is Rietveld 408576698