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

Unified Diff: components/history/core/browser/top_sites.cc

Issue 870063002: Componentize TopSites, TopSitesBackend, TopSitesDatabase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@815983002
Patch Set: 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: components/history/core/browser/top_sites.cc
diff --git a/components/history/core/browser/top_sites.cc b/components/history/core/browser/top_sites.cc
new file mode 100644
index 0000000000000000000000000000000000000000..535ba14013b2f4a8ed16a11b7e62f3d2ab18a06c
--- /dev/null
+++ b/components/history/core/browser/top_sites.cc
@@ -0,0 +1,47 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/history/core/browser/top_sites.h"
+
+namespace history {
+
+PrepopulatedPage::PrepopulatedPage()
+ : url(), favicon_id(-1), thumbnail_id(-1), color() {
+}
+
+PrepopulatedPage::PrepopulatedPage(const GURL& url,
+ const base::string16& title,
+ int favicon_id,
+ int thumbnail_id,
+ SkColor color)
+ : url(url, title),
+ favicon_id(favicon_id),
+ thumbnail_id(thumbnail_id),
+ color(color) {
+ this->url.redirects.push_back(url);
+}
+
+TopSites::TopSites() {
+}
+
+TopSites::~TopSites() {
+}
+
+void TopSites::AddObserver(TopSitesObserver* observer) {
+ observer_list_.AddObserver(observer);
+}
+
+void TopSites::RemoveObserver(TopSitesObserver* observer) {
+ observer_list_.RemoveObserver(observer);
+}
+
+void TopSites::NotifyTopSitesLoaded() {
+ FOR_EACH_OBSERVER(TopSitesObserver, observer_list_, TopSitesLoaded(this));
+}
+
+void TopSites::NotifyTopSitesChanged() {
+ FOR_EACH_OBSERVER(TopSitesObserver, observer_list_, TopSitesChanged(this));
+}
+
+} // namespace history

Powered by Google App Engine
This is Rietveld 408576698