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

Side by Side Diff: chrome/browser/autofill/autofill_manager.h

Issue 8488011: Moving AutofillAgent Logic into Browser (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Uncommenting HideAutofillPopup call Created 9 years, 1 month 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
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 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 static void RegisterUserPrefs(PrefService* prefs); 61 static void RegisterUserPrefs(PrefService* prefs);
62 62
63 // Set our external delegate. 63 // Set our external delegate.
64 // TODO(jrg): consider passing delegate into the ctor. That won't 64 // TODO(jrg): consider passing delegate into the ctor. That won't
65 // work if the delegate has a pointer to the AutofillManager, but 65 // work if the delegate has a pointer to the AutofillManager, but
66 // future directions may not need such a pointer. 66 // future directions may not need such a pointer.
67 void SetExternalDelegate(AutofillExternalDelegate* delegate) { 67 void SetExternalDelegate(AutofillExternalDelegate* delegate) {
68 external_delegate_ = delegate; 68 external_delegate_ = delegate;
69 } 69 }
70 70
71 // Called from our external delegate so they cannot be private.
72 void OnFillAutofillFormData(int query_id,
73 const webkit_glue::FormData& form,
74 const webkit_glue::FormField& field,
75 int unique_id);
76 void OnDidShowAutofillSuggestions(bool is_new_popup);
77 void OnDidFillAutofillFormData(const base::TimeTicks& timestamp);
78
71 protected: 79 protected:
72 // Only test code should subclass AutofillManager. 80 // Only test code should subclass AutofillManager.
73 friend class base::RefCounted<AutofillManager>; 81 friend class base::RefCounted<AutofillManager>;
74 virtual ~AutofillManager(); 82 virtual ~AutofillManager();
75 83
76 // The string/int pair is composed of the guid string and variant index 84 // The string/int pair is composed of the guid string and variant index
77 // respectively. The variant index is an index into the multi-valued item 85 // respectively. The variant index is an index into the multi-valued item
78 // (where applicable). 86 // (where applicable).
79 typedef std::pair<std::string, size_t> GUIDPair; 87 typedef std::pair<std::string, size_t> GUIDPair;
80 88
(...skipping 26 matching lines...) Expand all
107 // Methods for packing and unpacking credit card and profile IDs for sending 115 // Methods for packing and unpacking credit card and profile IDs for sending
108 // and receiving to and from the renderer process. 116 // and receiving to and from the renderer process.
109 int PackGUIDs(const GUIDPair& cc_guid, const GUIDPair& profile_guid) const; 117 int PackGUIDs(const GUIDPair& cc_guid, const GUIDPair& profile_guid) const;
110 void UnpackGUIDs(int id, GUIDPair* cc_guid, GUIDPair* profile_guid) const; 118 void UnpackGUIDs(int id, GUIDPair* cc_guid, GUIDPair* profile_guid) const;
111 119
112 const AutofillMetrics* metric_logger() const { return metric_logger_.get(); } 120 const AutofillMetrics* metric_logger() const { return metric_logger_.get(); }
113 void set_metric_logger(const AutofillMetrics* metric_logger); 121 void set_metric_logger(const AutofillMetrics* metric_logger);
114 122
115 ScopedVector<FormStructure>* form_structures() { return &form_structures_; } 123 ScopedVector<FormStructure>* form_structures() { return &form_structures_; }
116 124
117 // Called from our external delegate so it cannot be private.
118 void OnFillAutoFillFormData(int query_id,
119 const webkit_glue::FormData& form,
120 const webkit_glue::FormField& field,
121 int unique_id);
122
123 // Exposed for testing. 125 // Exposed for testing.
124 AutofillExternalDelegate* external_delegate() { 126 AutofillExternalDelegate* external_delegate() {
125 return external_delegate_; 127 return external_delegate_;
126 } 128 }
127 129
128 // Processes the submitted |form|, saving any new Autofill data and uploading 130 // Processes the submitted |form|, saving any new Autofill data and uploading
129 // the possible field types for the submitted fields to the crowdsouring 131 // the possible field types for the submitted fields to the crowdsouring
130 // server. Returns false if this form is not relevant for Autofill. 132 // server. Returns false if this form is not relevant for Autofill.
131 bool OnFormSubmitted(const webkit_glue::FormData& form, 133 bool OnFormSubmitted(const webkit_glue::FormData& form,
132 const base::TimeTicks& timestamp); 134 const base::TimeTicks& timestamp);
(...skipping 12 matching lines...) Expand all
145 void OnFormsSeen(const std::vector<webkit_glue::FormData>& forms, 147 void OnFormsSeen(const std::vector<webkit_glue::FormData>& forms,
146 const base::TimeTicks& timestamp); 148 const base::TimeTicks& timestamp);
147 void OnTextFieldDidChange(const webkit_glue::FormData& form, 149 void OnTextFieldDidChange(const webkit_glue::FormData& form,
148 const webkit_glue::FormField& field, 150 const webkit_glue::FormField& field,
149 const base::TimeTicks& timestamp); 151 const base::TimeTicks& timestamp);
150 152
151 // The |bounding_box| is a window relative value. 153 // The |bounding_box| is a window relative value.
152 void OnQueryFormFieldAutofill(int query_id, 154 void OnQueryFormFieldAutofill(int query_id,
153 const webkit_glue::FormData& form, 155 const webkit_glue::FormData& form,
154 const webkit_glue::FormField& field, 156 const webkit_glue::FormField& field,
155 const gfx::Rect& bounding_box); 157 const gfx::Rect& bounding_box,
156 void OnFillAutofillFormData(int query_id, 158 bool display_warning);
157 const webkit_glue::FormData& form,
158 const webkit_glue::FormField& field,
159 int unique_id);
160 void OnShowAutofillDialog(); 159 void OnShowAutofillDialog();
161 void OnDidPreviewAutofillFormData(); 160 void OnDidPreviewAutofillFormData();
162 void OnDidFillAutofillFormData(const base::TimeTicks& timestamp); 161 void OnDidEndTextFieldEditing();
163 void OnDidShowAutofillSuggestions(bool is_new_popup);
164 void OnHideAutofillPopup(); 162 void OnHideAutofillPopup();
165 163
166 // Fills |host| with the RenderViewHost for this tab. 164 // Fills |host| with the RenderViewHost for this tab.
167 // Returns false if Autofill is disabled or if the host is unavailable. 165 // Returns false if Autofill is disabled or if the host is unavailable.
168 bool GetHost(const std::vector<AutofillProfile*>& profiles, 166 bool GetHost(const std::vector<AutofillProfile*>& profiles,
169 const std::vector<CreditCard*>& credit_cards, 167 const std::vector<CreditCard*>& credit_cards,
170 RenderViewHost** host) const WARN_UNUSED_RESULT; 168 RenderViewHost** host) const WARN_UNUSED_RESULT;
171 169
172 // Unpacks |unique_id| and fills |profile| or |credit_card| with the 170 // Unpacks |unique_id| and fills |profile| or |credit_card| with the
173 // appropriate data source. Returns false if the unpacked id cannot be found. 171 // appropriate data source. Returns false if the unpacked id cannot be found.
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 TestTabContentsWithExternalDelegate); 328 TestTabContentsWithExternalDelegate);
331 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, 329 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest,
332 UserHappinessFormLoadAndSubmission); 330 UserHappinessFormLoadAndSubmission);
333 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); 331 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction);
334 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FormFillDuration); 332 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FormFillDuration);
335 333
336 DISALLOW_COPY_AND_ASSIGN(AutofillManager); 334 DISALLOW_COPY_AND_ASSIGN(AutofillManager);
337 }; 335 };
338 336
339 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ 337 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698