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

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

Issue 1309363007: [sessions] Remove most knowledge of //chrome from core tab restore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tab_restore_service_client
Patch Set: Make OnTabRestored() optional 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 unified diff | Download patch
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.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/sessions/chrome_tab_restore_service_client.h" 8 #include "chrome/browser/sessions/chrome_tab_restore_service_client.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h" 9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 TabRestoreServiceFactory::~TabRestoreServiceFactory() { 47 TabRestoreServiceFactory::~TabRestoreServiceFactory() {
48 } 48 }
49 49
50 bool TabRestoreServiceFactory::ServiceIsNULLWhileTesting() const { 50 bool TabRestoreServiceFactory::ServiceIsNULLWhileTesting() const {
51 return true; 51 return true;
52 } 52 }
53 53
54 KeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( 54 KeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor(
55 content::BrowserContext* browser_context) const { 55 content::BrowserContext* browser_context) const {
56 Profile* profile = Profile::FromBrowserContext(browser_context); 56 Profile* profile = Profile::FromBrowserContext(browser_context);
57 DCHECK(!profile->IsOffTheRecord());
57 scoped_ptr<sessions::TabRestoreServiceClient> client( 58 scoped_ptr<sessions::TabRestoreServiceClient> client(
58 new ChromeTabRestoreServiceClient(profile)); 59 new ChromeTabRestoreServiceClient(profile));
59 60
60 #if defined(OS_ANDROID) 61 #if defined(OS_ANDROID)
61 return new InMemoryTabRestoreService(profile, nullptr); 62 return new InMemoryTabRestoreService(profile, client.Pass(), nullptr);
62 #else 63 #else
63 return new PersistentTabRestoreService(profile, client.Pass(), nullptr); 64 return new PersistentTabRestoreService(profile, client.Pass(), nullptr);
64 #endif 65 #endif
65 } 66 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/persistent_tab_restore_service.cc ('k') | chrome/browser/sessions/tab_restore_service_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698