| Index: chrome/browser/history/top_sites_factory.cc
|
| diff --git a/chrome/browser/history/top_sites_factory.cc b/chrome/browser/history/top_sites_factory.cc
|
| index b85e843173f61520960648c100ff9ddccd31d5a8..66cdfbc22c52a6ab7132cddfd2ffb634d6a5a22d 100644
|
| --- a/chrome/browser/history/top_sites_factory.cc
|
| +++ b/chrome/browser/history/top_sites_factory.cc
|
| @@ -7,6 +7,7 @@
|
| #include <stddef.h>
|
|
|
| #include "base/bind.h"
|
| +#include "base/command_line.h"
|
| #include "base/macros.h"
|
| #include "base/memory/singleton.h"
|
| #include "build/build_config.h"
|
| @@ -27,6 +28,12 @@
|
|
|
| namespace {
|
|
|
| +const char kDisableTopSites[] = "disable-top-sites";
|
| +
|
| +bool IsTopSitesDisabled() {
|
| + return base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableTopSites);
|
| +}
|
| +
|
| struct RawPrepopulatedPage {
|
| int url_id; // The resource for the page URL.
|
| int title_id; // The resource for the page title.
|
| @@ -76,6 +83,8 @@ void InitializePrepopulatedPageList(
|
| // static
|
| scoped_refptr<history::TopSites> TopSitesFactory::GetForProfile(
|
| Profile* profile) {
|
| + if (IsTopSitesDisabled())
|
| + return nullptr;
|
| return static_cast<history::TopSites*>(
|
| GetInstance()->GetServiceForBrowserContext(profile, true).get());
|
| }
|
|
|