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

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

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 } 321 }
322 322
323 SendContentSuggestions(); 323 SendContentSuggestions();
324 } 324 }
325 325
326 void SnippetsInternalsMessageHandler::SendClassification() { 326 void SnippetsInternalsMessageHandler::SendClassification() {
327 web_ui()->CallJavascriptFunctionUnsafe( 327 web_ui()->CallJavascriptFunctionUnsafe(
328 "chrome.SnippetsInternals.receiveClassification", 328 "chrome.SnippetsInternals.receiveClassification",
329 base::StringValue(content_suggestions_service_->user_classifier() 329 base::StringValue(content_suggestions_service_->user_classifier()
330 ->GetUserClassDescriptionForDebugging()), 330 ->GetUserClassDescriptionForDebugging()),
331 base::FundamentalValue( 331 base::Value(
332 content_suggestions_service_->user_classifier()->GetEstimatedAvgTime( 332 content_suggestions_service_->user_classifier()->GetEstimatedAvgTime(
333 UserClassifier::Metric::NTP_OPENED)), 333 UserClassifier::Metric::NTP_OPENED)),
334 base::FundamentalValue( 334 base::Value(
335 content_suggestions_service_->user_classifier()->GetEstimatedAvgTime( 335 content_suggestions_service_->user_classifier()->GetEstimatedAvgTime(
336 UserClassifier::Metric::SUGGESTIONS_SHOWN)), 336 UserClassifier::Metric::SUGGESTIONS_SHOWN)),
337 base::FundamentalValue( 337 base::Value(
338 content_suggestions_service_->user_classifier()->GetEstimatedAvgTime( 338 content_suggestions_service_->user_classifier()->GetEstimatedAvgTime(
339 UserClassifier::Metric::SUGGESTIONS_USED))); 339 UserClassifier::Metric::SUGGESTIONS_USED)));
340 } 340 }
341 341
342 void SnippetsInternalsMessageHandler:: 342 void SnippetsInternalsMessageHandler::
343 SendLastRemoteSuggestionsBackgroundFetchTime() { 343 SendLastRemoteSuggestionsBackgroundFetchTime() {
344 base::Time time = base::Time::FromInternalValue(pref_service_->GetInt64( 344 base::Time time = base::Time::FromInternalValue(pref_service_->GetInt64(
345 ntp_snippets::prefs::kLastSuccessfulBackgroundFetchTime)); 345 ntp_snippets::prefs::kLastSuccessfulBackgroundFetchTime));
346 web_ui()->CallJavascriptFunctionUnsafe( 346 web_ui()->CallJavascriptFunctionUnsafe(
347 "chrome.SnippetsInternals." 347 "chrome.SnippetsInternals."
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded( 418 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded(
419 Category category, 419 Category category,
420 std::vector<ContentSuggestion> dismissed_suggestions) { 420 std::vector<ContentSuggestion> dismissed_suggestions) {
421 if (dismissed_state_[category] == DismissedState::HIDDEN) { 421 if (dismissed_state_[category] == DismissedState::HIDDEN) {
422 return; 422 return;
423 } 423 }
424 dismissed_suggestions_[category] = std::move(dismissed_suggestions); 424 dismissed_suggestions_[category] = std::move(dismissed_suggestions);
425 dismissed_state_[category] = DismissedState::VISIBLE; 425 dismissed_state_[category] = DismissedState::VISIBLE;
426 SendContentSuggestions(); 426 SendContentSuggestions();
427 } 427 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/site_settings_helper_unittest.cc ('k') | chrome/browser/ui/webui/sync_internals_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698