| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/install_tracker_factory.h" | 5 #include "chrome/browser/extensions/install_tracker_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
| 10 #include "chrome/browser/extensions/extension_system_factory.h" | 10 #include "chrome/browser/extensions/extension_system_factory.h" |
| 11 #include "chrome/browser/extensions/install_tracker.h" | 11 #include "chrome/browser/extensions/install_tracker.h" |
| 12 #include "chrome/browser/profiles/incognito_helpers.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/profiles/profile_dependency_manager.h" | 14 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 14 | 15 |
| 15 namespace extensions { | 16 namespace extensions { |
| 16 | 17 |
| 17 // static | 18 // static |
| 18 InstallTracker* InstallTrackerFactory::GetForProfile(Profile* profile) { | 19 InstallTracker* InstallTrackerFactory::GetForProfile(Profile* profile) { |
| 19 return static_cast<InstallTracker*>( | 20 return static_cast<InstallTracker*>( |
| 20 GetInstance()->GetServiceForProfile(profile, true)); | 21 GetInstance()->GetServiceForProfile(profile, true)); |
| 21 } | 22 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 34 } | 35 } |
| 35 | 36 |
| 36 ProfileKeyedService* InstallTrackerFactory::BuildServiceInstanceFor( | 37 ProfileKeyedService* InstallTrackerFactory::BuildServiceInstanceFor( |
| 37 content::BrowserContext* context) const { | 38 content::BrowserContext* context) const { |
| 38 Profile* profile = static_cast<Profile*>(context); | 39 Profile* profile = static_cast<Profile*>(context); |
| 39 ExtensionService* service = | 40 ExtensionService* service = |
| 40 extensions::ExtensionSystem::Get(profile)->extension_service(); | 41 extensions::ExtensionSystem::Get(profile)->extension_service(); |
| 41 return new InstallTracker(profile, service->extension_prefs()); | 42 return new InstallTracker(profile, service->extension_prefs()); |
| 42 } | 43 } |
| 43 | 44 |
| 44 bool InstallTrackerFactory::ServiceRedirectedInIncognito() const { | 45 content::BrowserContext* InstallTrackerFactory::GetBrowserContextToUse( |
| 46 content::BrowserContext* context) const { |
| 45 // The installs themselves are routed to the non-incognito profile and so | 47 // The installs themselves are routed to the non-incognito profile and so |
| 46 // should the install progress. | 48 // should the install progress. |
| 47 return true; | 49 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 48 } | 50 } |
| 49 | 51 |
| 50 } // namespace extensions | 52 } // namespace extensions |
| OLD | NEW |