OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/android/offline_pages/request_coordinator_factory.h" | 5 #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 | 42 |
43 // static | 43 // static |
44 RequestCoordinator* RequestCoordinatorFactory::GetForBrowserContext( | 44 RequestCoordinator* RequestCoordinatorFactory::GetForBrowserContext( |
45 content::BrowserContext* context) { | 45 content::BrowserContext* context) { |
46 return static_cast<RequestCoordinator*>( | 46 return static_cast<RequestCoordinator*>( |
47 GetInstance()->GetServiceForBrowserContext(context, true)); | 47 GetInstance()->GetServiceForBrowserContext(context, true)); |
48 } | 48 } |
49 | 49 |
50 KeyedService* RequestCoordinatorFactory::BuildServiceInstanceFor( | 50 KeyedService* RequestCoordinatorFactory::BuildServiceInstanceFor( |
51 content::BrowserContext* context) const { | 51 content::BrowserContext* context) const { |
52 if (context->IsOffTheRecord()) { | |
53 DVLOG(1) << "Can't create RequestCoordinator service for incognito mode"; | |
fgorski
2016/11/22 21:43:37
this change is not what you want. Remove GetBrowse
dougarnett
2016/11/22 22:01:16
Ok, I will revisit that. I tried that originally b
dougarnett
2016/11/22 22:28:06
Done.
| |
54 return nullptr; | |
55 } | |
56 | |
52 std::unique_ptr<OfflinerPolicy> policy(new OfflinerPolicy()); | 57 std::unique_ptr<OfflinerPolicy> policy(new OfflinerPolicy()); |
53 std::unique_ptr<OfflinerFactory> prerenderer_offliner( | 58 std::unique_ptr<OfflinerFactory> prerenderer_offliner( |
54 new PrerenderingOfflinerFactory(context)); | 59 new PrerenderingOfflinerFactory(context)); |
55 | 60 |
56 scoped_refptr<base::SequencedTaskRunner> background_task_runner = | 61 scoped_refptr<base::SequencedTaskRunner> background_task_runner = |
57 content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | 62 content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( |
58 content::BrowserThread::GetBlockingPool()->GetSequenceToken()); | 63 content::BrowserThread::GetBlockingPool()->GetSequenceToken()); |
59 Profile* profile = Profile::FromBrowserContext(context); | 64 Profile* profile = Profile::FromBrowserContext(context); |
60 base::FilePath queue_store_path = | 65 base::FilePath queue_store_path = |
61 profile->GetPath().Append(chrome::kOfflinePageRequestQueueDirname); | 66 profile->GetPath().Append(chrome::kOfflinePageRequestQueueDirname); |
(...skipping 12 matching lines...) Expand all Loading... | |
74 std::move(policy), std::move(prerenderer_offliner), std::move(queue), | 79 std::move(policy), std::move(prerenderer_offliner), std::move(queue), |
75 std::move(scheduler), network_quality_estimator); | 80 std::move(scheduler), network_quality_estimator); |
76 | 81 |
77 DownloadNotifyingObserver::CreateAndStartObserving( | 82 DownloadNotifyingObserver::CreateAndStartObserving( |
78 request_coordinator, | 83 request_coordinator, |
79 base::MakeUnique<android::OfflinePageNotificationBridge>()); | 84 base::MakeUnique<android::OfflinePageNotificationBridge>()); |
80 | 85 |
81 return request_coordinator; | 86 return request_coordinator; |
82 } | 87 } |
83 | 88 |
84 content::BrowserContext* RequestCoordinatorFactory::GetBrowserContextToUse( | 89 content::BrowserContext* RequestCoordinatorFactory::GetBrowserContextToUse( |
fgorski
2016/11/22 21:43:37
this is the code that needs to go.
dougarnett
2016/11/22 22:28:05
Acknowledged.
| |
85 content::BrowserContext* context) const { | 90 content::BrowserContext* context) const { |
86 // TODO(petewil): Make sure we support incognito properly. | 91 // TODO(petewil): Make sure we support incognito properly. |
87 return context; | 92 return context; |
88 } | 93 } |
89 | 94 |
90 } // namespace offline_pages | 95 } // namespace offline_pages |
OLD | NEW |