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

Side by Side Diff: chrome/browser/sessions/tab_restore_service_factory.cc

Issue 10989027: Split TabRestoreService into InMemoryTRS and PersistentTRS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some comments Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sessions/tab_restore_service_factory.h" 5 #include "chrome/browser/sessions/tab_restore_service_factory.h"
6 6
7 #include "chrome/browser/profiles/profile_dependency_manager.h" 7 #include "chrome/browser/profiles/profile_dependency_manager.h"
8 #include "chrome/browser/sessions/in_memory_tab_restore_service.h"
9 #include "chrome/browser/sessions/persistent_tab_restore_service.h"
8 #include "chrome/browser/sessions/tab_restore_service.h" 10 #include "chrome/browser/sessions/tab_restore_service.h"
9 11
10 // static 12 // static
11 TabRestoreService* TabRestoreServiceFactory::GetForProfile(Profile* profile) { 13 TabRestoreService* TabRestoreServiceFactory::GetForProfile(Profile* profile) {
12 return static_cast<TabRestoreService*>( 14 return static_cast<TabRestoreService*>(
13 GetInstance()->GetServiceForProfile(profile, true)); 15 GetInstance()->GetServiceForProfile(profile, true));
14 } 16 }
15 17
16 // static 18 // static
17 TabRestoreService* TabRestoreServiceFactory::GetForProfileIfExisting( 19 TabRestoreService* TabRestoreServiceFactory::GetForProfileIfExisting(
(...skipping 14 matching lines...) Expand all
32 } 34 }
33 35
34 TabRestoreServiceFactory::TabRestoreServiceFactory() 36 TabRestoreServiceFactory::TabRestoreServiceFactory()
35 : ProfileKeyedServiceFactory("TabRestoreService", 37 : ProfileKeyedServiceFactory("TabRestoreService",
36 ProfileDependencyManager::GetInstance()) { 38 ProfileDependencyManager::GetInstance()) {
37 } 39 }
38 40
39 TabRestoreServiceFactory::~TabRestoreServiceFactory() { 41 TabRestoreServiceFactory::~TabRestoreServiceFactory() {
40 } 42 }
41 43
42 ProfileKeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( 44 ProfileKeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor(
sky 2012/10/24 13:51:25 Can you move this to the corresponding service .cc
Philippe 2012/10/24 15:42:47 Good idea.
43 Profile* profile) const { 45 Profile* profile) const {
44 TabRestoreService* service = NULL; 46 TabRestoreService* service = NULL;
45 service = new TabRestoreService(profile); 47 #ifdef OS_ANDROID
48 // On Android tabs persistence is handled on the Java side.
49 service = new InMemoryTabRestoreService(profile);
50 #else
51 service = new PersistentTabRestoreService(profile);
52 #endif // OS_ANDROID
46 return service; 53 return service;
47 } 54 }
48 55
49 bool TabRestoreServiceFactory::ServiceIsNULLWhileTesting() const { 56 bool TabRestoreServiceFactory::ServiceIsNULLWhileTesting() const {
50 return true; 57 return true;
51 } 58 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698