From 0e30ef7b4eed575d9f4efd42ca23c18c7ca8bd6a Mon Sep 17 00:00:00 2001 From: "tony@chromium.org" Date: Sat, 5 Sep 2009 00:05:08 +0000 Subject: Move the "history is too new" dialog out of chrome/browser/history/history.cc. Instead use a notification that Browser picks up and delegates to BrowserWindow. Include implementations for Windows, Linux GTK+, and Linux Views (sorry, no mac impl). Review URL: http://codereview.chromium.org/200023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25556 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/history/history.cc | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'chrome/browser/history') diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc index 5cf61a9..8310c23 100644 --- a/chrome/browser/history/history.cc +++ b/chrome/browser/history/history.cc @@ -620,23 +620,9 @@ void HistoryService::SetInMemoryBackend( } void HistoryService::NotifyTooNew() { -#if defined(OS_WIN) - // Find the last browser window to display our message box from. - Browser* cur_browser = BrowserList::GetLastActive(); - // TODO(brettw): Do this some other way or beng will kick you. e.g. move to - // BrowserView. - HWND parent_hwnd = - reinterpret_cast(cur_browser->window()->GetNativeHandle()); - HWND cur_hwnd = cur_browser ? parent_hwnd : NULL; - - std::wstring title = l10n_util::GetString(IDS_PRODUCT_NAME); - std::wstring message = l10n_util::GetString(IDS_PROFILE_TOO_NEW_ERROR); - MessageBox(cur_hwnd, message.c_str(), title.c_str(), - MB_OK | MB_ICONWARNING | MB_TOPMOST); -#else - // TODO(port): factor this out into platform-specific code. - NOTIMPLEMENTED(); -#endif + Source source(this); + NotificationService::current()->Notify(NotificationType::HISTORY_TOO_NEW, + source, NotificationService::NoDetails()); } void HistoryService::DeleteURL(const GURL& url) { -- cgit v1.1