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

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

Issue 23857010: Revert "Revert 223907 "[password generation] Upload possible account cre..."" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 const gfx::RectF& bounds, 150 const gfx::RectF& bounds,
151 const std::vector<base::string16>& suggestions, 151 const std::vector<base::string16>& suggestions,
152 const std::vector<base::string16>& realms); 152 const std::vector<base::string16>& realms);
153 void OnSetDataList(const std::vector<base::string16>& values, 153 void OnSetDataList(const std::vector<base::string16>& values,
154 const std::vector<base::string16>& labels); 154 const std::vector<base::string16>& labels);
155 155
156 // Requests an interactive autocomplete UI be shown. 156 // Requests an interactive autocomplete UI be shown.
157 void OnRequestAutocomplete(const FormData& form, 157 void OnRequestAutocomplete(const FormData& form,
158 const GURL& frame_url); 158 const GURL& frame_url);
159 159
160 // Try and upload |form|. This differs from OnFormSubmitted() in a few ways.
161 // - This function will only label the first <input type="password"> field
162 // as ACCOUNT_CREATION_PASSWORD. Other fields will stay unlabeled, as they
163 // should have been labeled during the upload for OnFormSubmitted().
164 // - This function does not assume that |form| is being uploaded during
165 // the same browsing session as it was originally submitted (as we may
166 // not have the necessary information to classify the form at that time)
167 // so it bypasses the cache and doesn't log the same quality UMA metrics.
168 bool UploadPasswordGenerationForm(const FormData& form);
169
160 // Resets cache. 170 // Resets cache.
161 virtual void Reset(); 171 virtual void Reset();
162 172
163 protected: 173 protected:
164 // Test code should prefer to use this constructor. 174 // Test code should prefer to use this constructor.
165 AutofillManager(AutofillDriver* driver, 175 AutofillManager(AutofillDriver* driver,
166 autofill::AutofillManagerDelegate* delegate, 176 autofill::AutofillManagerDelegate* delegate,
167 PersonalDataManager* personal_data); 177 PersonalDataManager* personal_data);
168 178
169 // Returns the value of the AutofillEnabled pref. 179 // Returns the value of the AutofillEnabled pref.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 290
281 // Imports the form data, submitted by the user, into |personal_data_|. 291 // Imports the form data, submitted by the user, into |personal_data_|.
282 void ImportFormData(const FormStructure& submitted_form); 292 void ImportFormData(const FormStructure& submitted_form);
283 293
284 // If |initial_interaction_timestamp_| is unset or is set to a later time than 294 // If |initial_interaction_timestamp_| is unset or is set to a later time than
285 // |interaction_timestamp|, updates the cached timestamp. The latter check is 295 // |interaction_timestamp|, updates the cached timestamp. The latter check is
286 // needed because IPC messages can arrive out of order. 296 // needed because IPC messages can arrive out of order.
287 void UpdateInitialInteractionTimestamp( 297 void UpdateInitialInteractionTimestamp(
288 const base::TimeTicks& interaction_timestamp); 298 const base::TimeTicks& interaction_timestamp);
289 299
300 // Shared code to determine if |form| should be uploaded.
301 bool ShouldUploadForm(const FormStructure& form);
302
290 // Provides driver-level context to the shared code of the component. Must 303 // Provides driver-level context to the shared code of the component. Must
291 // outlive this object. 304 // outlive this object.
292 AutofillDriver* driver_; 305 AutofillDriver* driver_;
293 306
294 autofill::AutofillManagerDelegate* const manager_delegate_; 307 autofill::AutofillManagerDelegate* const manager_delegate_;
295 308
296 std::string app_locale_; 309 std::string app_locale_;
297 310
298 // The personal data manager, used to save and load personal data to/from the 311 // The personal data manager, used to save and load personal data to/from the
299 // web database. This is overridden by the AutofillManagerTest. 312 // web database. This is overridden by the AutofillManagerTest.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 UserHappinessFormLoadAndSubmission); 385 UserHappinessFormLoadAndSubmission);
373 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); 386 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction);
374 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, 387 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest,
375 FormSubmittedAutocompleteEnabled); 388 FormSubmittedAutocompleteEnabled);
376 DISALLOW_COPY_AND_ASSIGN(AutofillManager); 389 DISALLOW_COPY_AND_ASSIGN(AutofillManager);
377 }; 390 };
378 391
379 } // namespace autofill 392 } // namespace autofill
380 393
381 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ 394 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698