| 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/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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 SendClassification(); | 267 SendClassification(); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void SnippetsInternalsMessageHandler::FetchRemoteSuggestionsInTheBackground( | 270 void SnippetsInternalsMessageHandler::FetchRemoteSuggestionsInTheBackground( |
| 271 const base::ListValue* args) { | 271 const base::ListValue* args) { |
| 272 DCHECK_EQ(0u, args->GetSize()); | 272 DCHECK_EQ(0u, args->GetSize()); |
| 273 remote_suggestions_provider_->RefetchInTheBackground(nullptr); | 273 remote_suggestions_provider_->RefetchInTheBackground(nullptr); |
| 274 } | 274 } |
| 275 | 275 |
| 276 void SnippetsInternalsMessageHandler::SendAllContent() { | 276 void SnippetsInternalsMessageHandler::SendAllContent() { |
| 277 SendBoolean("flag-snippets", base::FeatureList::IsEnabled( | |
| 278 ntp_snippets::kContentSuggestionsFeature)); | |
| 279 SendBoolean( | 277 SendBoolean( |
| 280 "flag-article-suggestions", | 278 "flag-article-suggestions", |
| 281 base::FeatureList::IsEnabled(ntp_snippets::kArticleSuggestionsFeature)); | 279 base::FeatureList::IsEnabled(ntp_snippets::kArticleSuggestionsFeature)); |
| 282 SendBoolean("flag-recent-offline-tab-suggestions", | 280 SendBoolean("flag-recent-offline-tab-suggestions", |
| 283 base::FeatureList::IsEnabled( | 281 base::FeatureList::IsEnabled( |
| 284 ntp_snippets::kRecentOfflineTabSuggestionsFeature)); | 282 ntp_snippets::kRecentOfflineTabSuggestionsFeature)); |
| 285 SendBoolean("flag-offlining-recent-pages-feature", | 283 SendBoolean("flag-offlining-recent-pages-feature", |
| 286 base::FeatureList::IsEnabled( | 284 base::FeatureList::IsEnabled( |
| 287 offline_pages::kOffliningRecentPagesFeature)); | 285 offline_pages::kOffliningRecentPagesFeature)); |
| 288 SendBoolean( | 286 SendBoolean( |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 | 411 |
| 414 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded( | 412 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded( |
| 415 Category category, | 413 Category category, |
| 416 std::vector<ContentSuggestion> dismissed_suggestions) { | 414 std::vector<ContentSuggestion> dismissed_suggestions) { |
| 417 if (dismissed_state_[category] == DismissedState::HIDDEN) | 415 if (dismissed_state_[category] == DismissedState::HIDDEN) |
| 418 return; | 416 return; |
| 419 dismissed_suggestions_[category] = std::move(dismissed_suggestions); | 417 dismissed_suggestions_[category] = std::move(dismissed_suggestions); |
| 420 dismissed_state_[category] = DismissedState::VISIBLE; | 418 dismissed_state_[category] = DismissedState::VISIBLE; |
| 421 SendContentSuggestions(); | 419 SendContentSuggestions(); |
| 422 } | 420 } |
| OLD | NEW |