Chromium Code Reviews| Index: chrome/browser/dom_ui/history_ui.cc |
| =================================================================== |
| --- chrome/browser/dom_ui/history_ui.cc (revision 21505) |
| +++ chrome/browser/dom_ui/history_ui.cc (working copy) |
| @@ -117,6 +117,8 @@ |
| // Get notifications when history is cleared. |
| registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED, |
| Source<Profile>(dom_ui->GetProfile()->GetOriginalProfile())); |
| + registrar_.Add(this, NotificationType::URLS_STARRED, |
| + Source<Profile>(dom_ui->GetProfile()->GetOriginalProfile())); |
| return DOMMessageHandler::Attach(dom_ui); |
| } |
| @@ -345,13 +347,13 @@ |
| void BrowsingHistoryHandler::Observe(NotificationType type, |
| const NotificationSource& source, |
| const NotificationDetails& details) { |
| - if (type != NotificationType::HISTORY_URLS_DELETED) { |
| - NOTREACHED(); |
| - return; |
| + if (type == NotificationType::HISTORY_URLS_DELETED) { |
| + // Some URLs were deleted from history. Reload the list. |
| + dom_ui_->CallJavascriptFunction(L"historyDeleted"); |
| + } else if (type == NotificationType::URLS_STARRED) { |
| + // Maybe some bookmarks were added, removed, moved or favicon changed. |
| + dom_ui_->CallJavascriptFunction(L"reloadList"); |
|
Glen Murphy
2009/07/30 17:18:28
I don't think you want to make it reload the page
|
| } |
| - |
| - // Some URLs were deleted from history. Reload the list. |
| - dom_ui_->CallJavascriptFunction(L"historyDeleted"); |
| } |
| //////////////////////////////////////////////////////////////////////////////// |
| @@ -377,3 +379,4 @@ |
| return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + |
| EscapeQueryParamValue(WideToUTF8(text))); |
| } |
| + |