diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-06 10:37:49 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-06 10:37:49 +0000 |
commit | 058749bb1d39016bd1050879f97a356dc3a2f78c (patch) | |
tree | cda641b362dd19cbd0d70ccf63f57046b501cbff /chrome | |
parent | f9268a9615feeed557e0a143f86dc35bed6af3c3 (diff) | |
download | chromium_src-058749bb1d39016bd1050879f97a356dc3a2f78c.zip chromium_src-058749bb1d39016bd1050879f97a356dc3a2f78c.tar.gz chromium_src-058749bb1d39016bd1050879f97a356dc3a2f78c.tar.bz2 |
Don't reload the history page if something got deleted.
Only reload it if the user requested the deletion through the history page itself.
BUG=49475
TEST=none
Review URL: http://codereview.chromium.org/6691055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80600 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/resources/history.html | 10 | ||||
-rw-r--r-- | chrome/browser/resources/history2.html | 10 | ||||
-rw-r--r-- | chrome/browser/ui/webui/history2_ui.cc | 16 | ||||
-rw-r--r-- | chrome/browser/ui/webui/history2_ui.h | 11 | ||||
-rw-r--r-- | chrome/browser/ui/webui/history_ui.cc | 16 | ||||
-rw-r--r-- | chrome/browser/ui/webui/history_ui.h | 11 |
6 files changed, 4 insertions, 70 deletions
diff --git a/chrome/browser/resources/history.html b/chrome/browser/resources/history.html index 926560b..bc65141 100644 --- a/chrome/browser/resources/history.html +++ b/chrome/browser/resources/history.html @@ -1027,6 +1027,7 @@ function deleteComplete() { deleteNextInQueue(); } else { deleteQueue = []; + historyView.reload(); } } @@ -1040,15 +1041,6 @@ function deleteFailed() { deleteInFlight = false; setTimeout(deleteNextInQueue, 500); } - -/** - * We're called when something is deleted (either by us or by someone - * else). - */ -function historyDeleted() { - window.console.log('History deleted'); - historyView.reload(); -} </script> <link rel="stylesheet" href="webui.css"> <style> diff --git a/chrome/browser/resources/history2.html b/chrome/browser/resources/history2.html index ddff0a6..722a6ac 100644 --- a/chrome/browser/resources/history2.html +++ b/chrome/browser/resources/history2.html @@ -1059,6 +1059,7 @@ function deleteComplete() { deleteNextInQueue(); } else { deleteQueue = []; + historyView.reload(); } } @@ -1072,15 +1073,6 @@ function deleteFailed() { deleteInFlight = false; setTimeout(deleteNextInQueue, 500); } - -/** - * We're called when something is deleted (either by us or by someone - * else). - */ -function historyDeleted() { - window.console.log('History deleted'); - historyView.reload(); -} </script> <link rel="stylesheet" href="webui2.css"> <style> diff --git a/chrome/browser/ui/webui/history2_ui.cc b/chrome/browser/ui/webui/history2_ui.cc index ffe7cac..e0cb7df 100644 --- a/chrome/browser/ui/webui/history2_ui.cc +++ b/chrome/browser/ui/webui/history2_ui.cc @@ -31,7 +31,6 @@ #include "content/browser/browser_thread.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" -#include "content/common/notification_source.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -133,9 +132,6 @@ WebUIMessageHandler* BrowsingHistoryHandler2::Attach(WebUI* web_ui) { profile->GetChromeURLDataManager()->AddDataSource( new FaviconSource(profile)); - // Get notifications when history is cleared. - registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED, - Source<Profile>(web_ui->GetProfile()->GetOriginalProfile())); return WebUIMessageHandler::Attach(web_ui); } @@ -373,18 +369,6 @@ 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 diff --git a/chrome/browser/ui/webui/history2_ui.h b/chrome/browser/ui/webui/history2_ui.h index 15904b1..7643346 100644 --- a/chrome/browser/ui/webui/history2_ui.h +++ b/chrome/browser/ui/webui/history2_ui.h @@ -13,7 +13,6 @@ #include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "content/browser/cancelable_request.h" #include "content/browser/webui/web_ui.h" -#include "content/common/notification_registrar.h" class GURL; @@ -39,8 +38,7 @@ class HistoryUIHTMLSource2 : public ChromeURLDataManager::DataSource { }; // The handler for Javascript messages related to the "history" view. -class BrowsingHistoryHandler2 : public WebUIMessageHandler, - public NotificationObserver { +class BrowsingHistoryHandler2 : public WebUIMessageHandler { public: BrowsingHistoryHandler2(); virtual ~BrowsingHistoryHandler2(); @@ -61,11 +59,6 @@ class BrowsingHistoryHandler2 : public WebUIMessageHandler, // Handle for "clearBrowsingData" message. void HandleClearBrowsingData(const ListValue* args); - // NotificationObserver implementation. - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); - private: // Callback from the history system when the history list is available. void QueryComplete(HistoryService::Handle request_handle, @@ -82,8 +75,6 @@ class BrowsingHistoryHandler2 : public WebUIMessageHandler, // Figure out the query options for a month-wide query. history::QueryOptions CreateMonthQueryOptions(int month); - NotificationRegistrar registrar_; - // Current search text. string16 search_text_; diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc index 5b9b54b..c41257b 100644 --- a/chrome/browser/ui/webui/history_ui.cc +++ b/chrome/browser/ui/webui/history_ui.cc @@ -31,7 +31,6 @@ #include "content/browser/browser_thread.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" -#include "content/common/notification_source.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -133,9 +132,6 @@ WebUIMessageHandler* BrowsingHistoryHandler::Attach(WebUI* web_ui) { profile->GetChromeURLDataManager()->AddDataSource( new FaviconSource(profile)); - // Get notifications when history is cleared. - registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED, - Source<Profile>(profile->GetOriginalProfile())); return WebUIMessageHandler::Attach(web_ui); } @@ -361,18 +357,6 @@ 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"); -} - //////////////////////////////////////////////////////////////////////////////// // // HistoryUIContents diff --git a/chrome/browser/ui/webui/history_ui.h b/chrome/browser/ui/webui/history_ui.h index 1dfeb59..f505700 100644 --- a/chrome/browser/ui/webui/history_ui.h +++ b/chrome/browser/ui/webui/history_ui.h @@ -13,7 +13,6 @@ #include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "content/browser/cancelable_request.h" #include "content/browser/webui/web_ui.h" -#include "content/common/notification_registrar.h" class GURL; @@ -35,8 +34,7 @@ class HistoryUIHTMLSource : public ChromeURLDataManager::DataSource { }; // The handler for Javascript messages related to the "history" view. -class BrowsingHistoryHandler : public WebUIMessageHandler, - public NotificationObserver { +class BrowsingHistoryHandler : public WebUIMessageHandler { public: BrowsingHistoryHandler(); virtual ~BrowsingHistoryHandler(); @@ -57,11 +55,6 @@ class BrowsingHistoryHandler : public WebUIMessageHandler, // Handle for "clearBrowsingData" message. void HandleClearBrowsingData(const ListValue* args); - // NotificationObserver implementation. - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); - private: // Callback from the history system when the history list is available. void QueryComplete(HistoryService::Handle request_handle, @@ -78,8 +71,6 @@ class BrowsingHistoryHandler : public WebUIMessageHandler, // Figure out the query options for a month-wide query. history::QueryOptions CreateMonthQueryOptions(int month); - NotificationRegistrar registrar_; - // Current search text. string16 search_text_; |