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

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

Issue 2476493003: Remove FundamentalValue
Patch Set: Fix Created 4 years 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 312 }
313 313
314 SendContentSuggestions(); 314 SendContentSuggestions();
315 } 315 }
316 316
317 void SnippetsInternalsMessageHandler::SendClassification() { 317 void SnippetsInternalsMessageHandler::SendClassification() {
318 web_ui()->CallJavascriptFunctionUnsafe( 318 web_ui()->CallJavascriptFunctionUnsafe(
319 "chrome.SnippetsInternals.receiveClassification", 319 "chrome.SnippetsInternals.receiveClassification",
320 base::StringValue(content_suggestions_service_->user_classifier() 320 base::StringValue(content_suggestions_service_->user_classifier()
321 ->GetUserClassDescriptionForDebugging()), 321 ->GetUserClassDescriptionForDebugging()),
322 base::FundamentalValue( 322 base::Value(
323 content_suggestions_service_->user_classifier()->GetEstimatedAvgTime( 323 content_suggestions_service_->user_classifier()->GetEstimatedAvgTime(
324 UserClassifier::Metric::NTP_OPENED)), 324 UserClassifier::Metric::NTP_OPENED)),
325 base::FundamentalValue( 325 base::Value(
326 content_suggestions_service_->user_classifier()->GetEstimatedAvgTime( 326 content_suggestions_service_->user_classifier()->GetEstimatedAvgTime(
327 UserClassifier::Metric::SUGGESTIONS_SHOWN)), 327 UserClassifier::Metric::SUGGESTIONS_SHOWN)),
328 base::FundamentalValue( 328 base::Value(
329 content_suggestions_service_->user_classifier()->GetEstimatedAvgTime( 329 content_suggestions_service_->user_classifier()->GetEstimatedAvgTime(
330 UserClassifier::Metric::SUGGESTIONS_USED))); 330 UserClassifier::Metric::SUGGESTIONS_USED)));
331 } 331 }
332 332
333 void SnippetsInternalsMessageHandler::SendContentSuggestions() { 333 void SnippetsInternalsMessageHandler::SendContentSuggestions() {
334 std::unique_ptr<base::ListValue> categories_list(new base::ListValue); 334 std::unique_ptr<base::ListValue> categories_list(new base::ListValue);
335 335
336 int index = 0; 336 int index = 0;
337 for (Category category : content_suggestions_service_->GetCategories()) { 337 for (Category category : content_suggestions_service_->GetCategories()) {
338 CategoryStatus status = 338 CategoryStatus status =
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 396
397 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded( 397 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded(
398 Category category, 398 Category category,
399 std::vector<ContentSuggestion> dismissed_suggestions) { 399 std::vector<ContentSuggestion> dismissed_suggestions) {
400 if (dismissed_state_[category] == DismissedState::HIDDEN) 400 if (dismissed_state_[category] == DismissedState::HIDDEN)
401 return; 401 return;
402 dismissed_suggestions_[category] = std::move(dismissed_suggestions); 402 dismissed_suggestions_[category] = std::move(dismissed_suggestions);
403 dismissed_state_[category] = DismissedState::VISIBLE; 403 dismissed_state_[category] = DismissedState::VISIBLE;
404 SendContentSuggestions(); 404 SendContentSuggestions();
405 } 405 }
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