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

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

Issue 2665743002: [Remote suggestions] Clean up variation params in the fetcher. (Closed)
Patch Set: Add a comment Created 3 years, 10 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/about_flags.cc ('k') | components/ntp_snippets/remote/json_request.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 307
308 SendBoolean("flag-physical-web", base::FeatureList::IsEnabled( 308 SendBoolean("flag-physical-web", base::FeatureList::IsEnabled(
309 chrome::android::kPhysicalWebFeature)); 309 chrome::android::kPhysicalWebFeature));
310 310
311 SendClassification(); 311 SendClassification();
312 SendLastRemoteSuggestionsBackgroundFetchTime(); 312 SendLastRemoteSuggestionsBackgroundFetchTime();
313 313
314 if (remote_suggestions_provider_) { 314 if (remote_suggestions_provider_) {
315 const ntp_snippets::RemoteSuggestionsFetcher* fetcher = 315 const ntp_snippets::RemoteSuggestionsFetcher* fetcher =
316 remote_suggestions_provider_->suggestions_fetcher_for_debugging(); 316 remote_suggestions_provider_->suggestions_fetcher_for_debugging();
317 // TODO(fhorschig): Read this string from variations directly.
318 SendString("switch-personalized", fetcher->PersonalizationModeString());
319
320 SendString("switch-fetch-url", fetcher->fetch_url().spec()); 317 SendString("switch-fetch-url", fetcher->fetch_url().spec());
321 web_ui()->CallJavascriptFunctionUnsafe( 318 web_ui()->CallJavascriptFunctionUnsafe(
322 "chrome.SnippetsInternals.receiveJson", 319 "chrome.SnippetsInternals.receiveJson",
323 base::StringValue(fetcher->last_json())); 320 base::StringValue(fetcher->last_json()));
324 } 321 }
325 322
326 SendContentSuggestions(); 323 SendContentSuggestions();
327 } 324 }
328 325
329 void SnippetsInternalsMessageHandler::SendClassification() { 326 void SnippetsInternalsMessageHandler::SendClassification() {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded( 418 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded(
422 Category category, 419 Category category,
423 std::vector<ContentSuggestion> dismissed_suggestions) { 420 std::vector<ContentSuggestion> dismissed_suggestions) {
424 if (dismissed_state_[category] == DismissedState::HIDDEN) { 421 if (dismissed_state_[category] == DismissedState::HIDDEN) {
425 return; 422 return;
426 } 423 }
427 dismissed_suggestions_[category] = std::move(dismissed_suggestions); 424 dismissed_suggestions_[category] = std::move(dismissed_suggestions);
428 dismissed_state_[category] = DismissedState::VISIBLE; 425 dismissed_state_[category] = DismissedState::VISIBLE;
429 SendContentSuggestions(); 426 SendContentSuggestions();
430 } 427 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | components/ntp_snippets/remote/json_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698