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

Side by Side Diff: components/autofill/core/browser/autofill_manager.cc

Issue 2776223002: Adds UKM for autofill attributes in form_structure. (Closed)
Patch Set: Uses vector of pairs instead of map for metrics. 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/autofill/core/browser/autofill_manager.h" 5 #include "components/autofill/core/browser/autofill_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1906 matching lines...) Expand 10 before | Expand all | Expand 10 after
1917 auto form_structure = base::MakeUnique<FormStructure>(form); 1917 auto form_structure = base::MakeUnique<FormStructure>(form);
1918 form_structure->ParseFieldTypesFromAutocompleteAttributes(); 1918 form_structure->ParseFieldTypesFromAutocompleteAttributes();
1919 if (!form_structure->ShouldBeParsed()) 1919 if (!form_structure->ShouldBeParsed())
1920 return false; 1920 return false;
1921 1921
1922 // Ownership is transferred to |form_structures_| which maintains it until 1922 // Ownership is transferred to |form_structures_| which maintains it until
1923 // the manager is Reset() or destroyed. It is safe to use references below 1923 // the manager is Reset() or destroyed. It is safe to use references below
1924 // as long as receivers don't take ownership. 1924 // as long as receivers don't take ownership.
1925 form_structures_.push_back(std::move(form_structure)); 1925 form_structures_.push_back(std::move(form_structure));
1926 *parsed_form_structure = form_structures_.back().get(); 1926 *parsed_form_structure = form_structures_.back().get();
1927 (*parsed_form_structure)->DetermineHeuristicTypes(); 1927 (*parsed_form_structure)->DetermineHeuristicTypes(client_->GetUkmService());
1928 return true; 1928 return true;
1929 } 1929 }
1930 1930
1931 int AutofillManager::BackendIDToInt(const std::string& backend_id) const { 1931 int AutofillManager::BackendIDToInt(const std::string& backend_id) const {
1932 if (!base::IsValidGUID(backend_id)) 1932 if (!base::IsValidGUID(backend_id))
1933 return 0; 1933 return 0;
1934 1934
1935 const auto found = backend_to_int_map_.find(backend_id); 1935 const auto found = backend_to_int_map_.find(backend_id);
1936 if (found == backend_to_int_map_.end()) { 1936 if (found == backend_to_int_map_.end()) {
1937 // Unknown one, make a new entry. 1937 // Unknown one, make a new entry.
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 } 2197 }
2198 #endif // ENABLE_FORM_DEBUG_DUMP 2198 #endif // ENABLE_FORM_DEBUG_DUMP
2199 2199
2200 void AutofillManager::LogCardUploadDecisionUkm( 2200 void AutofillManager::LogCardUploadDecisionUkm(
2201 AutofillMetrics::CardUploadDecisionMetric upload_decision) { 2201 AutofillMetrics::CardUploadDecisionMetric upload_decision) {
2202 AutofillMetrics::LogCardUploadDecisionUkm( 2202 AutofillMetrics::LogCardUploadDecisionUkm(
2203 client_->GetUkmService(), pending_upload_request_url_, upload_decision); 2203 client_->GetUkmService(), pending_upload_request_url_, upload_decision);
2204 } 2204 }
2205 2205
2206 } // namespace autofill 2206 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698