Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: chrome/browser/extensions/install_tracker_factory.cc

Issue 13865012: Change GetProfileToUse method from Profile to content::BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698