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

Side by Side Diff: chrome/browser/autofill/autofill_manager_unittest.cc

Issue 7740070: Add metrics to measure time elapsed between form load and form submission with or without Autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Once more, with feeling Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/autofill/autofill_manager.cc ('k') | chrome/browser/autofill/autofill_metrics.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
11 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
12 #include "base/stringprintf.h" 12 #include "base/stringprintf.h"
13 #include "base/time.h"
13 #include "base/tuple.h" 14 #include "base/tuple.h"
14 #include "base/utf_string_conversions.h" 15 #include "base/utf_string_conversions.h"
15 #include "chrome/browser/autocomplete_history_manager.h" 16 #include "chrome/browser/autocomplete_history_manager.h"
16 #include "chrome/browser/autofill/autofill_common_test.h" 17 #include "chrome/browser/autofill/autofill_common_test.h"
17 #include "chrome/browser/autofill/autofill_manager.h" 18 #include "chrome/browser/autofill/autofill_manager.h"
18 #include "chrome/browser/autofill/autofill_profile.h" 19 #include "chrome/browser/autofill/autofill_profile.h"
19 #include "chrome/browser/autofill/credit_card.h" 20 #include "chrome/browser/autofill/credit_card.h"
20 #include "chrome/browser/autofill/personal_data_manager.h" 21 #include "chrome/browser/autofill/personal_data_manager.h"
21 #include "chrome/browser/prefs/pref_service.h" 22 #include "chrome/browser/prefs/pref_service.h"
22 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 const webkit_glue::FormField& field) { 506 const webkit_glue::FormField& field) {
506 GetAutofillSuggestions(kDefaultPageID, form, field); 507 GetAutofillSuggestions(kDefaultPageID, form, field);
507 } 508 }
508 509
509 void AutocompleteSuggestionsReturned(const std::vector<string16>& result) { 510 void AutocompleteSuggestionsReturned(const std::vector<string16>& result) {
510 contents_wrapper()->autocomplete_history_manager()-> 511 contents_wrapper()->autocomplete_history_manager()->
511 SendSuggestions(&result); 512 SendSuggestions(&result);
512 } 513 }
513 514
514 void FormsSeen(const std::vector<webkit_glue::FormData>& forms) { 515 void FormsSeen(const std::vector<webkit_glue::FormData>& forms) {
515 autofill_manager_->OnFormsSeen(forms); 516 autofill_manager_->OnFormsSeen(forms, base::TimeTicks());
516 } 517 }
517 518
518 void FormSubmitted(const FormData& form) { 519 void FormSubmitted(const FormData& form) {
519 autofill_manager_->OnFormSubmitted(form); 520 autofill_manager_->OnFormSubmitted(form, base::TimeTicks::Now());
520 } 521 }
521 522
522 void FillAutofillFormData(int query_id, 523 void FillAutofillFormData(int query_id,
523 const webkit_glue::FormData& form, 524 const webkit_glue::FormData& form,
524 const webkit_glue::FormField& field, 525 const webkit_glue::FormField& field,
525 int unique_id) { 526 int unique_id) {
526 autofill_manager_->OnFillAutofillFormData(query_id, form, field, unique_id); 527 autofill_manager_->OnFillAutofillFormData(query_id, form, field, unique_id);
527 } 528 }
528 529
529 bool GetAutofillSuggestionsMessage(int* page_id, 530 bool GetAutofillSuggestionsMessage(int* page_id,
(...skipping 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after
2771 const FieldTypeSet& possible_types1 = 2772 const FieldTypeSet& possible_types1 =
2772 form_structure.field(1)->possible_types(); 2773 form_structure.field(1)->possible_types();
2773 EXPECT_EQ(1U, possible_types1.size()); 2774 EXPECT_EQ(1U, possible_types1.size());
2774 EXPECT_TRUE(possible_types1.find(NAME_FIRST) != possible_types1.end()); 2775 EXPECT_TRUE(possible_types1.find(NAME_FIRST) != possible_types1.end());
2775 const FieldTypeSet& possible_types2 = 2776 const FieldTypeSet& possible_types2 =
2776 form_structure.field(2)->possible_types(); 2777 form_structure.field(2)->possible_types();
2777 EXPECT_EQ(1U, possible_types2.size()); 2778 EXPECT_EQ(1U, possible_types2.size());
2778 EXPECT_TRUE(possible_types2.find(UNKNOWN_TYPE) != 2779 EXPECT_TRUE(possible_types2.find(UNKNOWN_TYPE) !=
2779 possible_types2.end()); 2780 possible_types2.end());
2780 } 2781 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_manager.cc ('k') | chrome/browser/autofill/autofill_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698