| 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/session_service_factory.h" | 5 #include "chrome/browser/sessions/session_service_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" |
| 7 #include "chrome/browser/profiles/profile_dependency_manager.h" | 8 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 8 #include "chrome/browser/sessions/session_service.h" | 9 #include "chrome/browser/sessions/session_service.h" |
| 9 | 10 |
| 10 // static | 11 // static |
| 11 SessionService* SessionServiceFactory::GetForProfile(Profile* profile) { | 12 SessionService* SessionServiceFactory::GetForProfile(Profile* profile) { |
| 12 #if defined(OS_ANDROID) | 13 #if defined(OS_ANDROID) |
| 13 // For Android we do not store sessions in the SessionService. | 14 // For Android we do not store sessions in the SessionService. |
| 14 return NULL; | 15 return NULL; |
| 15 #else | 16 #else |
| 16 return static_cast<SessionService*>( | 17 return static_cast<SessionService*>( |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 52 |
| 52 SessionServiceFactory::SessionServiceFactory() | 53 SessionServiceFactory::SessionServiceFactory() |
| 53 : ProfileKeyedServiceFactory("SessionService", | 54 : ProfileKeyedServiceFactory("SessionService", |
| 54 ProfileDependencyManager::GetInstance()) { | 55 ProfileDependencyManager::GetInstance()) { |
| 55 } | 56 } |
| 56 | 57 |
| 57 SessionServiceFactory::~SessionServiceFactory() { | 58 SessionServiceFactory::~SessionServiceFactory() { |
| 58 } | 59 } |
| 59 | 60 |
| 60 ProfileKeyedService* SessionServiceFactory::BuildServiceInstanceFor( | 61 ProfileKeyedService* SessionServiceFactory::BuildServiceInstanceFor( |
| 61 Profile* profile) const { | 62 content::BrowserContext* profile) const { |
| 62 SessionService* service = NULL; | 63 SessionService* service = NULL; |
| 63 service = new SessionService(profile); | 64 service = new SessionService(static_cast<Profile*>(profile)); |
| 64 service->ResetFromCurrentBrowsers(); | 65 service->ResetFromCurrentBrowsers(); |
| 65 return service; | 66 return service; |
| 66 } | 67 } |
| 67 | 68 |
| 68 bool SessionServiceFactory::ServiceIsCreatedWithProfile() const { | 69 bool SessionServiceFactory::ServiceIsCreatedWithProfile() const { |
| 69 return true; | 70 return true; |
| 70 } | 71 } |
| 71 | 72 |
| 72 bool SessionServiceFactory::ServiceIsNULLWhileTesting() const { | 73 bool SessionServiceFactory::ServiceIsNULLWhileTesting() const { |
| 73 return true; | 74 return true; |
| 74 } | 75 } |
| OLD | NEW |