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

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

Issue 7086030: Refresh the history page if history entries get deleted, except for when currently editing entries (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 6 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/ui/webui/history_ui.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d5620b7539381a4406a0966bbd4b1a6a9ca71d52..c4803f87ae5cfb617880eea63e28855f2ec73d6d 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -32,6 +32,7 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_delegate.h"
#include "content/browser/user_metrics.h"
+#include "content/common/notification_source.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -135,6 +136,9 @@ WebUIMessageHandler* BrowsingHistoryHandler::Attach(WebUI* web_ui) {
profile->GetChromeURLDataManager()->AddDataSource(
new FaviconSource(profile, FaviconSource::FAVICON));
+ // Get notifications when history is cleared.
+ registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED,
+ Source<Profile>(profile->GetOriginalProfile()));
return WebUIMessageHandler::Attach(web_ui);
}
@@ -360,6 +364,18 @@ history::QueryOptions BrowsingHistoryHandler::CreateMonthQueryOptions(
return options;
}
+void BrowsingHistoryHandler::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ if (type != NotificationType::HISTORY_URLS_DELETED) {
+ NOTREACHED();
+ return;
+ }
+
+ // Some URLs were deleted from history. Reload the list.
+ web_ui_->CallJavascriptFunction("historyDeleted");
+}
+
////////////////////////////////////////////////////////////////////////////////
//
// HistoryUI
« no previous file with comments | « chrome/browser/ui/webui/history_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698