| Index: chrome/browser/ui/webui/history2_ui.cc
|
| diff --git a/chrome/browser/ui/webui/history2_ui.cc b/chrome/browser/ui/webui/history2_ui.cc
|
| index 0bb9d1b95bde1db2bd37f8087e3d4c80dee93cf1..c9cab20a1f629fa10d7193ee440ab768fdfc5de4 100644
|
| --- a/chrome/browser/ui/webui/history2_ui.cc
|
| +++ b/chrome/browser/ui/webui/history2_ui.cc
|
| @@ -31,6 +31,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"
|
| @@ -132,6 +133,9 @@ WebUIMessageHandler* BrowsingHistoryHandler2::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>(web_ui->GetProfile()->GetOriginalProfile()));
|
| return WebUIMessageHandler::Attach(web_ui);
|
| }
|
|
|
| @@ -369,6 +373,18 @@ history::QueryOptions BrowsingHistoryHandler2::CreateMonthQueryOptions(
|
| return options;
|
| }
|
|
|
| +void BrowsingHistoryHandler2::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");
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| //
|
| // HistoryUIContents
|
|
|