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

Side by Side Diff: chrome/browser/ui/webui/snippets_internals_message_handler.cc

Issue 2609423002: [NTP::RecentTabs] Enable by default and depend on recent tabs flag. (Closed)
Patch Set: Created 3 years, 11 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 | « chrome/browser/resources/snippets_internals.html ('k') | components/ntp_snippets/features.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/ui/webui/snippets_internals_message_handler.h" 5 #include "chrome/browser/ui/webui/snippets_internals_message_handler.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 13 matching lines...) Expand all
24 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h" 24 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h"
25 #include "chrome/browser/profiles/profile.h" 25 #include "chrome/browser/profiles/profile.h"
26 #include "chrome/common/chrome_features.h" 26 #include "chrome/common/chrome_features.h"
27 #include "components/ntp_snippets/category.h" 27 #include "components/ntp_snippets/category.h"
28 #include "components/ntp_snippets/category_info.h" 28 #include "components/ntp_snippets/category_info.h"
29 #include "components/ntp_snippets/features.h" 29 #include "components/ntp_snippets/features.h"
30 #include "components/ntp_snippets/pref_names.h" 30 #include "components/ntp_snippets/pref_names.h"
31 #include "components/ntp_snippets/remote/ntp_snippets_fetcher.h" 31 #include "components/ntp_snippets/remote/ntp_snippets_fetcher.h"
32 #include "components/ntp_snippets/remote/remote_suggestions_provider.h" 32 #include "components/ntp_snippets/remote/remote_suggestions_provider.h"
33 #include "components/ntp_snippets/switches.h" 33 #include "components/ntp_snippets/switches.h"
34 #include "components/offline_pages/core/offline_page_feature.h"
34 #include "components/prefs/pref_service.h" 35 #include "components/prefs/pref_service.h"
35 #include "content/public/browser/web_ui.h" 36 #include "content/public/browser/web_ui.h"
36 37
37 using ntp_snippets::ContentSuggestion; 38 using ntp_snippets::ContentSuggestion;
38 using ntp_snippets::Category; 39 using ntp_snippets::Category;
39 using ntp_snippets::CategoryInfo; 40 using ntp_snippets::CategoryInfo;
40 using ntp_snippets::CategoryStatus; 41 using ntp_snippets::CategoryStatus;
41 using ntp_snippets::KnownCategories; 42 using ntp_snippets::KnownCategories;
42 using ntp_snippets::RemoteSuggestionsProvider; 43 using ntp_snippets::RemoteSuggestionsProvider;
43 using ntp_snippets::UserClassifier; 44 using ntp_snippets::UserClassifier;
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 274
274 void SnippetsInternalsMessageHandler::SendAllContent() { 275 void SnippetsInternalsMessageHandler::SendAllContent() {
275 SendBoolean("flag-snippets", base::FeatureList::IsEnabled( 276 SendBoolean("flag-snippets", base::FeatureList::IsEnabled(
276 ntp_snippets::kContentSuggestionsFeature)); 277 ntp_snippets::kContentSuggestionsFeature));
277 SendBoolean( 278 SendBoolean(
278 "flag-article-suggestions", 279 "flag-article-suggestions",
279 base::FeatureList::IsEnabled(ntp_snippets::kArticleSuggestionsFeature)); 280 base::FeatureList::IsEnabled(ntp_snippets::kArticleSuggestionsFeature));
280 SendBoolean("flag-recent-offline-tab-suggestions", 281 SendBoolean("flag-recent-offline-tab-suggestions",
281 base::FeatureList::IsEnabled( 282 base::FeatureList::IsEnabled(
282 ntp_snippets::kRecentOfflineTabSuggestionsFeature)); 283 ntp_snippets::kRecentOfflineTabSuggestionsFeature));
284 SendBoolean("flag-offlining-recent-pages-feature",
285 base::FeatureList::IsEnabled(
286 offline_pages::kOffliningRecentPagesFeature));
283 SendBoolean( 287 SendBoolean(
284 "flag-asset-download-suggestions", 288 "flag-asset-download-suggestions",
285 base::FeatureList::IsEnabled(features::kAssetDownloadSuggestionsFeature)); 289 base::FeatureList::IsEnabled(features::kAssetDownloadSuggestionsFeature));
286 SendBoolean("flag-offline-page-download-suggestions", 290 SendBoolean("flag-offline-page-download-suggestions",
287 base::FeatureList::IsEnabled( 291 base::FeatureList::IsEnabled(
288 features::kOfflinePageDownloadSuggestionsFeature)); 292 features::kOfflinePageDownloadSuggestionsFeature));
289 SendBoolean( 293 SendBoolean(
290 "flag-bookmark-suggestions", 294 "flag-bookmark-suggestions",
291 base::FeatureList::IsEnabled(ntp_snippets::kBookmarkSuggestionsFeature)); 295 base::FeatureList::IsEnabled(ntp_snippets::kBookmarkSuggestionsFeature));
292 296
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 411
408 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded( 412 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded(
409 Category category, 413 Category category,
410 std::vector<ContentSuggestion> dismissed_suggestions) { 414 std::vector<ContentSuggestion> dismissed_suggestions) {
411 if (dismissed_state_[category] == DismissedState::HIDDEN) 415 if (dismissed_state_[category] == DismissedState::HIDDEN)
412 return; 416 return;
413 dismissed_suggestions_[category] = std::move(dismissed_suggestions); 417 dismissed_suggestions_[category] = std::move(dismissed_suggestions);
414 dismissed_state_[category] = DismissedState::VISIBLE; 418 dismissed_state_[category] = DismissedState::VISIBLE;
415 SendContentSuggestions(); 419 SendContentSuggestions();
416 } 420 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/snippets_internals.html ('k') | components/ntp_snippets/features.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698