Commit 44640d47 authored by sdefresne's avatar sdefresne Committed by Commit bot

Fix TopSitesObserver implementation

Add a virtual destructor since all class with a virtual method should
have a virtual destructor.

Disable copy constructor and assignment operator using the macro
DISALLOW_COPY_AND_ASSIGN since you don't want to do slicing when
using a class with virtual methods.

BUG=None

Review URL: https://codereview.chromium.org/853643003

Cr-Commit-Position: refs/heads/master@{#311473}
parent 7bc51702
...@@ -5,18 +5,26 @@ ...@@ -5,18 +5,26 @@
#ifndef COMPONENTS_HISTORY_CORE_BROWSER_TOP_SITES_OBSERVER_H_ #ifndef COMPONENTS_HISTORY_CORE_BROWSER_TOP_SITES_OBSERVER_H_
#define COMPONENTS_HISTORY_CORE_BROWSER_TOP_SITES_OBSERVER_H_ #define COMPONENTS_HISTORY_CORE_BROWSER_TOP_SITES_OBSERVER_H_
#include "base/macros.h"
namespace history { namespace history {
class TopSites; class TopSites;
// Interface for observing notifications from TopSites. // Interface for observing notifications from TopSites.
class TopSitesObserver { class TopSitesObserver {
public: public:
TopSitesObserver() {}
virtual ~TopSitesObserver() {}
// Is called when TopSites finishes loading. // Is called when TopSites finishes loading.
virtual void TopSitesLoaded(history::TopSites* top_sites) = 0; virtual void TopSitesLoaded(history::TopSites* top_sites) = 0;
// Is called when either one of the most visited urls // Is called when either one of the most visited urls
// changed, or one of the images changes. // changed, or one of the images changes.
virtual void TopSitesChanged(history::TopSites* top_sites) = 0; virtual void TopSitesChanged(history::TopSites* top_sites) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(TopSitesObserver);
}; };
} // namespace history } // namespace history
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment