OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/feature_engagement_tracker/feature_engagement_tracker_f
actory.h" | 5 #include "chrome/browser/feature_engagement_tracker/feature_engagement_tracker_f
actory.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 BrowserContextDependencyManager::GetInstance()) {} | 36 BrowserContextDependencyManager::GetInstance()) {} |
37 | 37 |
38 FeatureEngagementTrackerFactory::~FeatureEngagementTrackerFactory() = default; | 38 FeatureEngagementTrackerFactory::~FeatureEngagementTrackerFactory() = default; |
39 | 39 |
40 KeyedService* FeatureEngagementTrackerFactory::BuildServiceInstanceFor( | 40 KeyedService* FeatureEngagementTrackerFactory::BuildServiceInstanceFor( |
41 content::BrowserContext* context) const { | 41 content::BrowserContext* context) const { |
42 Profile* profile = Profile::FromBrowserContext(context); | 42 Profile* profile = Profile::FromBrowserContext(context); |
43 | 43 |
44 scoped_refptr<base::SequencedTaskRunner> background_task_runner = | 44 scoped_refptr<base::SequencedTaskRunner> background_task_runner = |
45 base::CreateSequencedTaskRunnerWithTraits( | 45 base::CreateSequencedTaskRunnerWithTraits( |
46 base::TaskTraits().MayBlock().WithPriority( | 46 {base::MayBlock(), base::TaskPriority::BACKGROUND}); |
47 base::TaskPriority::BACKGROUND)); | |
48 | 47 |
49 base::FilePath storage_dir = profile->GetPath().Append( | 48 base::FilePath storage_dir = profile->GetPath().Append( |
50 chrome::kFeatureEngagementTrackerStorageDirname); | 49 chrome::kFeatureEngagementTrackerStorageDirname); |
51 | 50 |
52 return feature_engagement_tracker::FeatureEngagementTracker::Create( | 51 return feature_engagement_tracker::FeatureEngagementTracker::Create( |
53 storage_dir, background_task_runner); | 52 storage_dir, background_task_runner); |
54 } | 53 } |
55 | 54 |
56 content::BrowserContext* | 55 content::BrowserContext* |
57 FeatureEngagementTrackerFactory::GetBrowserContextToUse( | 56 FeatureEngagementTrackerFactory::GetBrowserContextToUse( |
58 content::BrowserContext* context) const { | 57 content::BrowserContext* context) const { |
59 return chrome::GetBrowserContextRedirectedInIncognito(context); | 58 return chrome::GetBrowserContextRedirectedInIncognito(context); |
60 } | 59 } |
OLD | NEW |