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

Side by Side Diff: chrome/browser/ntp_snippets/content_suggestions_service_factory.cc

Issue 2236303002: Make OfflinePage ContentSuggestions dismissable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: base::Value --> std::unique_ptr<base::Value> Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ntp_snippets/content_suggestions_service_factory.h" 5 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h"
6 6
7 #include "base/feature_list.h" 7 #include "base/feature_list.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 #if defined(OS_ANDROID) 127 #if defined(OS_ANDROID)
128 // Create the OfflinePageSuggestionsProvider. 128 // Create the OfflinePageSuggestionsProvider.
129 if (base::FeatureList::IsEnabled( 129 if (base::FeatureList::IsEnabled(
130 ntp_snippets::kOfflinePageSuggestionsFeature)) { 130 ntp_snippets::kOfflinePageSuggestionsFeature)) {
131 OfflinePageModel* offline_page_model = 131 OfflinePageModel* offline_page_model =
132 OfflinePageModelFactory::GetForBrowserContext(profile); 132 OfflinePageModelFactory::GetForBrowserContext(profile);
133 133
134 std::unique_ptr<OfflinePageSuggestionsProvider> 134 std::unique_ptr<OfflinePageSuggestionsProvider>
135 offline_page_suggestions_provider = 135 offline_page_suggestions_provider =
136 base::MakeUnique<OfflinePageSuggestionsProvider>( 136 base::MakeUnique<OfflinePageSuggestionsProvider>(
137 service, service->category_factory(), offline_page_model); 137 service, service->category_factory(), offline_page_model,
138 profile->GetPrefs());
138 service->RegisterProvider(std::move(offline_page_suggestions_provider)); 139 service->RegisterProvider(std::move(offline_page_suggestions_provider));
139 } 140 }
140 #endif // OS_ANDROID 141 #endif // OS_ANDROID
141 142
142 // Create the BookmarkSuggestionsProvider. 143 // Create the BookmarkSuggestionsProvider.
143 if (base::FeatureList::IsEnabled( 144 if (base::FeatureList::IsEnabled(
144 ntp_snippets::kBookmarkSuggestionsFeature)) { 145 ntp_snippets::kBookmarkSuggestionsFeature)) {
145 BookmarkModel* bookmark_model = 146 BookmarkModel* bookmark_model =
146 BookmarkModelFactory::GetForBrowserContext(profile); 147 BookmarkModelFactory::GetForBrowserContext(profile);
147 std::unique_ptr<BookmarkSuggestionsProvider> bookmark_suggestions_provider = 148 std::unique_ptr<BookmarkSuggestionsProvider> bookmark_suggestions_provider =
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 base::MakeUnique<ImageDecoderImpl>(), 189 base::MakeUnique<ImageDecoderImpl>(),
189 base::MakeUnique<NTPSnippetsDatabase>(database_dir, task_runner), 190 base::MakeUnique<NTPSnippetsDatabase>(database_dir, task_runner),
190 base::MakeUnique<NTPSnippetsStatusService>(signin_manager, 191 base::MakeUnique<NTPSnippetsStatusService>(signin_manager,
191 profile->GetPrefs())); 192 profile->GetPrefs()));
192 service->set_ntp_snippets_service(ntp_snippets_service.get()); 193 service->set_ntp_snippets_service(ntp_snippets_service.get());
193 service->RegisterProvider(std::move(ntp_snippets_service)); 194 service->RegisterProvider(std::move(ntp_snippets_service));
194 } 195 }
195 196
196 return service; 197 return service;
197 } 198 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698