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_dependency_manager.h" | 7 #include "chrome/browser/profiles/profile_dependency_manager.h" |
8 #include "chrome/browser/sessions/session_service.h" | 8 #include "chrome/browser/sessions/session_service.h" |
9 | 9 |
10 // static | 10 // static |
11 SessionService* SessionServiceFactory::GetForProfile(Profile* profile) { | 11 SessionService* SessionServiceFactory::GetForProfile(Profile* profile) { |
12 #if defined(OS_ANDROID) | |
sky
2012/08/02 14:46:43
Ping erg on this. I think there is a better way to
| |
13 // For Android we do not store sessions in the SessionService. | |
14 return NULL; | |
15 #else | |
12 return static_cast<SessionService*>( | 16 return static_cast<SessionService*>( |
13 GetInstance()->GetServiceForProfile(profile, true)); | 17 GetInstance()->GetServiceForProfile(profile, true)); |
18 #endif | |
14 } | 19 } |
15 | 20 |
16 // static | 21 // static |
17 SessionService* SessionServiceFactory::GetForProfileIfExisting( | 22 SessionService* SessionServiceFactory::GetForProfileIfExisting( |
18 Profile* profile) { | 23 Profile* profile) { |
24 #if defined(OS_ANDROID) | |
25 // For Android we do not store sessions in the SessionService. | |
26 return NULL; | |
27 #else | |
19 return static_cast<SessionService*>( | 28 return static_cast<SessionService*>( |
20 GetInstance()->GetServiceForProfile(profile, false)); | 29 GetInstance()->GetServiceForProfile(profile, false)); |
30 #endif | |
21 } | 31 } |
22 | 32 |
23 // static | 33 // static |
24 void SessionServiceFactory::ShutdownForProfile(Profile* profile) { | 34 void SessionServiceFactory::ShutdownForProfile(Profile* profile) { |
25 // We're about to exit, force creation of the session service if it hasn't | 35 // We're about to exit, force creation of the session service if it hasn't |
26 // been created yet. We do this to ensure session state matches the point in | 36 // been created yet. We do this to ensure session state matches the point in |
27 // time the user exited. | 37 // time the user exited. |
28 SessionServiceFactory* factory = GetInstance(); | 38 SessionServiceFactory* factory = GetInstance(); |
29 factory->GetServiceForProfile(profile, true); | 39 factory->GetServiceForProfile(profile, true); |
30 | 40 |
(...skipping 24 matching lines...) Expand all Loading... | |
55 return service; | 65 return service; |
56 } | 66 } |
57 | 67 |
58 bool SessionServiceFactory::ServiceIsCreatedWithProfile() { | 68 bool SessionServiceFactory::ServiceIsCreatedWithProfile() { |
59 return true; | 69 return true; |
60 } | 70 } |
61 | 71 |
62 bool SessionServiceFactory::ServiceIsNULLWhileTesting() { | 72 bool SessionServiceFactory::ServiceIsNULLWhileTesting() { |
63 return true; | 73 return true; |
64 } | 74 } |
OLD | NEW |