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

Side by Side Diff: components/ntp_snippets/ntp_snippets_service.cc

Issue 2059203002: Add ContentSuggestion, ContentSuggestionCategory and ContentSuggestionProviderType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ntp_snippets/ntp_snippets_service.h" 5 #include "components/ntp_snippets/ntp_snippets_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 18 matching lines...) Expand all
29 #include "components/suggestions/proto/suggestions.pb.h" 29 #include "components/suggestions/proto/suggestions.pb.h"
30 #include "components/sync_driver/sync_service.h" 30 #include "components/sync_driver/sync_service.h"
31 #include "components/variations/variations_associated_data.h" 31 #include "components/variations/variations_associated_data.h"
32 #include "ui/gfx/image/image.h" 32 #include "ui/gfx/image/image.h"
33 33
34 using image_fetcher::ImageFetcher; 34 using image_fetcher::ImageFetcher;
35 using suggestions::ChromeSuggestion; 35 using suggestions::ChromeSuggestion;
36 using suggestions::SuggestionsProfile; 36 using suggestions::SuggestionsProfile;
37 using suggestions::SuggestionsService; 37 using suggestions::SuggestionsService;
38 38
39 // TODO IMPORTANT NOTE: This service will move to a sub-namespace and become
40 // a SnippetProvider. To access available snippets from outside, please use the
41 // "SnippetService".
Marc Treib 2016/06/13 13:08:17 Not necessary here, the comment in the header is e
Philipp Keck 2016/06/13 14:13:14 Done.
42
39 namespace ntp_snippets { 43 namespace ntp_snippets {
40 44
41 namespace { 45 namespace {
42 46
43 // Number of snippets requested to the server. Consider replacing sparse UMA 47 // Number of snippets requested to the server. Consider replacing sparse UMA
44 // histograms with COUNTS() if this number increases beyond 50. 48 // histograms with COUNTS() if this number increases beyond 50.
45 const int kMaxSnippetCount = 10; 49 const int kMaxSnippetCount = 10;
46 50
47 // Default values for snippets fetching intervals. 51 // Default values for snippets fetching intervals.
48 const int kDefaultFetchingIntervalWifiChargingSeconds = 30 * 60; 52 const int kDefaultFetchingIntervalWifiChargingSeconds = 30 * 60;
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 return; 732 return;
729 } 733 }
730 } 734 }
731 735
732 void NTPSnippetsService::ClearDeprecatedPrefs() { 736 void NTPSnippetsService::ClearDeprecatedPrefs() {
733 pref_service_->ClearPref(prefs::kDeprecatedSnippets); 737 pref_service_->ClearPref(prefs::kDeprecatedSnippets);
734 pref_service_->ClearPref(prefs::kDeprecatedDiscardedSnippets); 738 pref_service_->ClearPref(prefs::kDeprecatedDiscardedSnippets);
735 } 739 }
736 740
737 } // namespace ntp_snippets 741 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698