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

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

Issue 2786023002: [Remote suggestions] Remove the unique_ptr wrapper around callbacks (Closed)
Patch Set: Created 3 years, 8 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 | components/ntp_snippets/remote/remote_suggestions_provider.h » ('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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 const base::ListValue* args) { 307 const base::ListValue* args) {
308 DCHECK_EQ(0u, args->GetSize()); 308 DCHECK_EQ(0u, args->GetSize());
309 content_suggestions_service_->user_classifier() 309 content_suggestions_service_->user_classifier()
310 ->ClearClassificationForDebugging(); 310 ->ClearClassificationForDebugging();
311 SendClassification(); 311 SendClassification();
312 } 312 }
313 313
314 void SnippetsInternalsMessageHandler::FetchRemoteSuggestionsInTheBackground( 314 void SnippetsInternalsMessageHandler::FetchRemoteSuggestionsInTheBackground(
315 const base::ListValue* args) { 315 const base::ListValue* args) {
316 DCHECK_EQ(0u, args->GetSize()); 316 DCHECK_EQ(0u, args->GetSize());
317 remote_suggestions_provider_->RefetchInTheBackground(nullptr); 317 remote_suggestions_provider_->RefetchInTheBackground(
318 RemoteSuggestionsProvider::FetchStatusCallback());
318 } 319 }
319 320
320 void SnippetsInternalsMessageHandler::SendAllContent() { 321 void SnippetsInternalsMessageHandler::SendAllContent() {
321 SendBoolean( 322 SendBoolean(
322 "flag-article-suggestions", 323 "flag-article-suggestions",
323 base::FeatureList::IsEnabled(ntp_snippets::kArticleSuggestionsFeature)); 324 base::FeatureList::IsEnabled(ntp_snippets::kArticleSuggestionsFeature));
324 SendBoolean("flag-recent-offline-tab-suggestions", 325 SendBoolean("flag-recent-offline-tab-suggestions",
325 base::FeatureList::IsEnabled( 326 base::FeatureList::IsEnabled(
326 ntp_snippets::kRecentOfflineTabSuggestionsFeature)); 327 ntp_snippets::kRecentOfflineTabSuggestionsFeature));
327 SendBoolean("flag-offlining-recent-pages-feature", 328 SendBoolean("flag-offlining-recent-pages-feature",
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded( 455 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded(
455 Category category, 456 Category category,
456 std::vector<ContentSuggestion> dismissed_suggestions) { 457 std::vector<ContentSuggestion> dismissed_suggestions) {
457 if (dismissed_state_[category] == DismissedState::HIDDEN) { 458 if (dismissed_state_[category] == DismissedState::HIDDEN) {
458 return; 459 return;
459 } 460 }
460 dismissed_suggestions_[category] = std::move(dismissed_suggestions); 461 dismissed_suggestions_[category] = std::move(dismissed_suggestions);
461 dismissed_state_[category] = DismissedState::VISIBLE; 462 dismissed_state_[category] = DismissedState::VISIBLE;
462 SendContentSuggestions(); 463 SendContentSuggestions();
463 } 464 }
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/remote/remote_suggestions_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698