summaryrefslogtreecommitdiffstats
path: root/chrome/test/testing_profile.h
diff options
context:
space:
mode:
authornshkrob@chromium.org <nshkrob@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 17:20:34 +0000
committernshkrob@chromium.org <nshkrob@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 17:20:34 +0000
commita8ab8866ba372136850107c08afabb8079945afc (patch)
treede2942a813d6efea5f7c494f0752c0b6a622e12b /chrome/test/testing_profile.h
parent6a3ca9862ab2959c6a51595323aee4fc3fae4f2a (diff)
downloadchromium_src-a8ab8866ba372136850107c08afabb8079945afc.zip
chromium_src-a8ab8866ba372136850107c08afabb8079945afc.tar.gz
chromium_src-a8ab8866ba372136850107c08afabb8079945afc.tar.bz2
Replace --top-sites flag with --no-top-sites flag. TopSites becomes the default.
BUG=none TEST=manual Review URL: http://codereview.chromium.org/3054028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55244 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/testing_profile.h')
-rw-r--r--chrome/test/testing_profile.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h
index 36f638f..dd8976e 100644
--- a/chrome/test/testing_profile.h
+++ b/chrome/test/testing_profile.h
@@ -9,6 +9,7 @@
#include "base/base_paths.h"
#include "base/file_util.h"
#include "base/path_service.h"
+#include "base/scoped_temp_dir.h"
#include "chrome/browser/autocomplete/autocomplete_classifier.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/browser_prefs.h"
@@ -20,6 +21,7 @@
#include "chrome/browser/geolocation/geolocation_permission_context.h"
#include "chrome/browser/host_content_settings_map.h"
#include "chrome/browser/history/history.h"
+#include "chrome/browser/history/top_sites.h"
#include "chrome/browser/in_process_webkit/webkit_context.h"
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/pref_service.h"
@@ -163,7 +165,16 @@ class TestingProfile : public Profile {
return template_url_model_.get();
}
virtual TemplateURLFetcher* GetTemplateURLFetcher() { return NULL; }
- virtual history::TopSites* GetTopSites() { return NULL; }
+ virtual history::TopSites* GetTopSites() {
+ if (!top_sites_.get()) {
+ top_sites_ = new history::TopSites(this);
+ if (!temp_dir_.CreateUniqueTempDir())
+ return NULL;
+ FilePath file_name = temp_dir_.path().AppendASCII("TopSites.db");
+ top_sites_->Init(file_name);
+ }
+ return top_sites_;
+ }
virtual DownloadManager* GetDownloadManager() { return NULL; }
virtual PersonalDataManager* GetPersonalDataManager() { return NULL; }
virtual bool HasCreatedDownloadManager() const { return false; }
@@ -372,6 +383,8 @@ class TestingProfile : public Profile {
scoped_ptr<FindBarState> find_bar_state_;
FilePath last_selected_directory_;
+ scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails.
+ ScopedTempDir temp_dir_;
};
// A profile that derives from another profile. This does not actually