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

Unified Diff: chrome/browser/history/chrome_history_client.cc

Issue 845013002: Remove TopSites notification in favor of Observers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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
Index: chrome/browser/history/chrome_history_client.cc
diff --git a/chrome/browser/history/chrome_history_client.cc b/chrome/browser/history/chrome_history_client.cc
index b6a529b785df8c44f037eb5a4bf0b8d4ab329c8a..0d3657010040680fc86555b701b28ebfed45f2fa 100644
--- a/chrome/browser/history/chrome_history_client.cc
+++ b/chrome/browser/history/chrome_history_client.cc
@@ -5,32 +5,19 @@
#include "chrome/browser/history/chrome_history_client.h"
#include "base/logging.h"
-#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/history_notifications.h"
-#include "chrome/browser/history/top_sites.h"
#include "chrome/browser/ui/profile_error_dialog.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/bookmarks/browser/bookmark_model.h"
-#include "content/public/browser/notification_service.h"
-using bookmarks::BookmarkModel;
-
-ChromeHistoryClient::ChromeHistoryClient(BookmarkModel* bookmark_model,
- Profile* profile,
- history::TopSites* top_sites)
- : bookmark_model_(bookmark_model),
- profile_(profile),
- top_sites_(top_sites) {
+ChromeHistoryClient::ChromeHistoryClient(
+ bookmarks::BookmarkModel* bookmark_model)
+ : bookmark_model_(bookmark_model) {
DCHECK(bookmark_model_);
- if (top_sites_)
- top_sites_->AddObserver(this);
}
ChromeHistoryClient::~ChromeHistoryClient() {
- if (top_sites_)
- top_sites_->RemoveObserver(this);
}
void ChromeHistoryClient::BlockUntilBookmarksLoaded() {
@@ -43,7 +30,7 @@ bool ChromeHistoryClient::IsBookmarked(const GURL& url) {
void ChromeHistoryClient::GetBookmarks(
std::vector<history::URLAndTitle>* bookmarks) {
- std::vector<BookmarkModel::URLAndTitle> bookmarks_url_and_title;
+ std::vector<bookmarks::BookmarkModel::URLAndTitle> bookmarks_url_and_title;
bookmark_model_->GetBookmarks(&bookmarks_url_and_title);
bookmarks->reserve(bookmarks->size() + bookmarks_url_and_title.size());
@@ -82,17 +69,3 @@ void ChromeHistoryClient::Shutdown() {
// sees an incorrect view of bookmarks, but it's better than a deadlock.
bookmark_model_->Shutdown();
}
-
-void ChromeHistoryClient::TopSitesLoaded(history::TopSites* top_sites) {
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_TOP_SITES_LOADED,
- content::Source<Profile>(profile_),
- content::Details<history::TopSites>(top_sites));
-}
-
-void ChromeHistoryClient::TopSitesChanged(history::TopSites* top_sites) {
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_TOP_SITES_CHANGED,
- content::Source<history::TopSites>(top_sites),
- content::NotificationService::NoDetails());
-}
« no previous file with comments | « chrome/browser/history/chrome_history_client.h ('k') | chrome/browser/history/chrome_history_client_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698