OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |