| 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/extensions/api/autotest_private/autotest_private_api_fa
ctory.h" | 5 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api_fa
ctory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api.h" | 7 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api.h" |
| 8 #include "chrome/browser/extensions/extension_system_factory.h" | 8 #include "chrome/browser/extensions/extension_system_factory.h" |
| 9 #include "chrome/browser/profiles/incognito_helpers.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_dependency_manager.h" | 11 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 11 | 12 |
| 12 namespace extensions { | 13 namespace extensions { |
| 13 | 14 |
| 14 // static | 15 // static |
| 15 AutotestPrivateAPI* AutotestPrivateAPIFactory::GetForProfile(Profile* profile) { | 16 AutotestPrivateAPI* AutotestPrivateAPIFactory::GetForProfile(Profile* profile) { |
| 16 return static_cast<AutotestPrivateAPI*>(GetInstance()-> | 17 return static_cast<AutotestPrivateAPI*>(GetInstance()-> |
| 17 GetServiceForProfile(profile, true)); | 18 GetServiceForProfile(profile, true)); |
| 18 } | 19 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 29 } | 30 } |
| 30 | 31 |
| 31 AutotestPrivateAPIFactory::~AutotestPrivateAPIFactory() { | 32 AutotestPrivateAPIFactory::~AutotestPrivateAPIFactory() { |
| 32 } | 33 } |
| 33 | 34 |
| 34 ProfileKeyedService* AutotestPrivateAPIFactory::BuildServiceInstanceFor( | 35 ProfileKeyedService* AutotestPrivateAPIFactory::BuildServiceInstanceFor( |
| 35 content::BrowserContext* profile) const { | 36 content::BrowserContext* profile) const { |
| 36 return new AutotestPrivateAPI(); | 37 return new AutotestPrivateAPI(); |
| 37 } | 38 } |
| 38 | 39 |
| 39 bool AutotestPrivateAPIFactory::ServiceRedirectedInIncognito() const { | 40 content::BrowserContext* AutotestPrivateAPIFactory::GetBrowserContextToUse( |
| 40 return true; | 41 content::BrowserContext* context) const { |
| 42 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 41 } | 43 } |
| 42 | 44 |
| 43 bool AutotestPrivateAPIFactory::ServiceIsCreatedWithProfile() const { | 45 bool AutotestPrivateAPIFactory::ServiceIsCreatedWithProfile() const { |
| 44 return true; | 46 return true; |
| 45 } | 47 } |
| 46 | 48 |
| 47 bool AutotestPrivateAPIFactory::ServiceIsNULLWhileTesting() const { | 49 bool AutotestPrivateAPIFactory::ServiceIsNULLWhileTesting() const { |
| 48 return true; | 50 return true; |
| 49 } | 51 } |
| 50 | 52 |
| 51 } // namespace extensions | 53 } // namespace extensions |
| OLD | NEW |