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

Side by Side Diff: components/offline_pages/core/prefetch/prefetch_service_impl.cc

Issue 2864293003: [Offline Pages] Add a GCMAppHandler for offline page prefetch. (Closed)
Patch Set: Fix windows compile. Created 3 years, 6 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
OLDNEW
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 "components/offline_pages/core/prefetch/prefetch_service_impl.h" 5 #include "components/offline_pages/core/prefetch/prefetch_service_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "components/offline_pages/core/prefetch/prefetch_dispatcher_impl.h" 10 #include "components/offline_pages/core/prefetch/prefetch_dispatcher_impl.h"
11 11
12 namespace offline_pages { 12 namespace offline_pages {
13 13
14 PrefetchServiceImpl::PrefetchServiceImpl() 14 PrefetchServiceImpl::PrefetchServiceImpl()
15 : dispatcher_(base::MakeUnique<PrefetchDispatcherImpl>()) {} 15 : dispatcher_(base::MakeUnique<PrefetchDispatcherImpl>()) {}
16 16
17 PrefetchServiceImpl::~PrefetchServiceImpl() = default; 17 PrefetchServiceImpl::~PrefetchServiceImpl() = default;
18 18
19 void PrefetchServiceImpl::ObserveContentSuggestionsService(
20 ntp_snippets::ContentSuggestionsService* service) {
fgorski 2017/05/30 18:20:05 CHECK or DCHECK to ensure we are not passing in th
dewittj 2017/05/30 21:09:18 Not going to change this code in this patch.
21 suggested_articles_observer_ =
22 base::MakeUnique<SuggestedArticlesObserver>(service, this);
23 }
24
25 void PrefetchServiceImpl::AddPrefetchGCMHandler(
26 std::unique_ptr<PrefetchGCMHandler> app_handler) {
27 gcm_handler_ = std::move(app_handler);
28 }
29
19 PrefetchDispatcher* PrefetchServiceImpl::GetDispatcher() { 30 PrefetchDispatcher* PrefetchServiceImpl::GetDispatcher() {
20 return dispatcher_.get(); 31 return dispatcher_.get();
21 }; 32 }
22 33
23 void PrefetchServiceImpl::Shutdown() {} 34 void PrefetchServiceImpl::Shutdown() {}
24 35
25 } // namespace offline_pages 36 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698