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

Unified Diff: chrome/browser/sessions/tab_restore_service_factory.cc

Issue 1319473014: Introduce TabRestoreServiceClient and //chrome implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 5 years, 3 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/sessions/tab_restore_service_factory.cc
diff --git a/chrome/browser/sessions/tab_restore_service_factory.cc b/chrome/browser/sessions/tab_restore_service_factory.cc
index 3c457ed9809b9c4500abec38f5dee5fa0a4336bc..a0d5db400d9353f16cf4023697bbf0c1584fda28 100644
--- a/chrome/browser/sessions/tab_restore_service_factory.cc
+++ b/chrome/browser/sessions/tab_restore_service_factory.cc
@@ -5,9 +5,15 @@
#include "chrome/browser/sessions/tab_restore_service_factory.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/sessions/tab_restore_service.h"
+#include "chrome/browser/sessions/chrome_tab_restore_service_client.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#if defined(OS_ANDROID)
+#include "chrome/browser/sessions/in_memory_tab_restore_service.h"
+#else
+#include "chrome/browser/sessions/persistent_tab_restore_service.h"
+#endif
+
// static
TabRestoreService* TabRestoreServiceFactory::GetForProfile(Profile* profile) {
return static_cast<TabRestoreService*>(
@@ -44,3 +50,16 @@ TabRestoreServiceFactory::~TabRestoreServiceFactory() {
bool TabRestoreServiceFactory::ServiceIsNULLWhileTesting() const {
return true;
}
+
+KeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* browser_context) const {
+ Profile* profile = Profile::FromBrowserContext(browser_context);
+ scoped_ptr<sessions::TabRestoreServiceClient> client(
+ new ChromeTabRestoreServiceClient(profile));
+
+#if defined(OS_ANDROID)
+ return new InMemoryTabRestoreService(profile, nullptr);
+#else
+ return new PersistentTabRestoreService(profile, client.Pass(), nullptr);
+#endif
+}
« no previous file with comments | « chrome/browser/sessions/tab_restore_service_factory.h ('k') | chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698