| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/autofill_manager.h" | 5 #include "components/autofill/browser/autofill_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "components/autofill/common/autofill_messages.h" | 39 #include "components/autofill/common/autofill_messages.h" |
| 40 #include "components/autofill/common/autofill_pref_names.h" | 40 #include "components/autofill/common/autofill_pref_names.h" |
| 41 #include "components/autofill/common/autofill_switches.h" | 41 #include "components/autofill/common/autofill_switches.h" |
| 42 #include "components/autofill/common/form_data.h" | 42 #include "components/autofill/common/form_data.h" |
| 43 #include "components/autofill/common/form_data_predictions.h" | 43 #include "components/autofill/common/form_data_predictions.h" |
| 44 #include "components/autofill/common/form_field_data.h" | 44 #include "components/autofill/common/form_field_data.h" |
| 45 #include "components/autofill/common/password_form_fill_data.h" | 45 #include "components/autofill/common/password_form_fill_data.h" |
| 46 #include "components/user_prefs/pref_registry_syncable.h" | 46 #include "components/user_prefs/pref_registry_syncable.h" |
| 47 #include "content/public/browser/browser_context.h" | 47 #include "content/public/browser/browser_context.h" |
| 48 #include "content/public/browser/browser_thread.h" | 48 #include "content/public/browser/browser_thread.h" |
| 49 #include "content/public/browser/navigation_details.h" |
| 49 #include "content/public/browser/render_view_host.h" | 50 #include "content/public/browser/render_view_host.h" |
| 50 #include "content/public/browser/web_contents.h" | 51 #include "content/public/browser/web_contents.h" |
| 51 #include "content/public/browser/web_contents_view.h" | 52 #include "content/public/browser/web_contents_view.h" |
| 52 #include "content/public/common/url_constants.h" | 53 #include "content/public/common/url_constants.h" |
| 53 #include "googleurl/src/gurl.h" | 54 #include "googleurl/src/gurl.h" |
| 54 #include "grit/component_resources.h" | 55 #include "grit/component_resources.h" |
| 55 #include "ipc/ipc_message_macros.h" | 56 #include "ipc/ipc_message_macros.h" |
| 56 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" | 57 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" |
| 57 #include "ui/base/l10n/l10n_util.h" | 58 #include "ui/base/l10n/l10n_util.h" |
| 58 #include "ui/gfx/rect.h" | 59 #include "ui/gfx/rect.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 253 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 253 registry->RegisterDoublePref( | 254 registry->RegisterDoublePref( |
| 254 prefs::kAutofillNegativeUploadRate, | 255 prefs::kAutofillNegativeUploadRate, |
| 255 kAutofillNegativeUploadRateDefaultValue, | 256 kAutofillNegativeUploadRateDefaultValue, |
| 256 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 257 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 257 } | 258 } |
| 258 | 259 |
| 259 void AutofillManager::DidNavigateMainFrame( | 260 void AutofillManager::DidNavigateMainFrame( |
| 260 const content::LoadCommittedDetails& details, | 261 const content::LoadCommittedDetails& details, |
| 261 const content::FrameNavigateParams& params) { | 262 const content::FrameNavigateParams& params) { |
| 262 Reset(); | 263 if (details.is_navigation_to_different_page()) |
| 264 Reset(); |
| 263 } | 265 } |
| 264 | 266 |
| 265 void AutofillManager::SetExternalDelegate(AutofillExternalDelegate* delegate) { | 267 void AutofillManager::SetExternalDelegate(AutofillExternalDelegate* delegate) { |
| 266 // TODO(jrg): consider passing delegate into the ctor. That won't | 268 // TODO(jrg): consider passing delegate into the ctor. That won't |
| 267 // work if the delegate has a pointer to the AutofillManager, but | 269 // work if the delegate has a pointer to the AutofillManager, but |
| 268 // future directions may not need such a pointer. | 270 // future directions may not need such a pointer. |
| 269 external_delegate_ = delegate; | 271 external_delegate_ = delegate; |
| 270 autocomplete_history_manager_.SetExternalDelegate(delegate); | 272 autocomplete_history_manager_.SetExternalDelegate(delegate); |
| 271 } | 273 } |
| 272 | 274 |
| (...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 | 1296 |
| 1295 void AutofillManager::UpdateInitialInteractionTimestamp( | 1297 void AutofillManager::UpdateInitialInteractionTimestamp( |
| 1296 const TimeTicks& interaction_timestamp) { | 1298 const TimeTicks& interaction_timestamp) { |
| 1297 if (initial_interaction_timestamp_.is_null() || | 1299 if (initial_interaction_timestamp_.is_null() || |
| 1298 interaction_timestamp < initial_interaction_timestamp_) { | 1300 interaction_timestamp < initial_interaction_timestamp_) { |
| 1299 initial_interaction_timestamp_ = interaction_timestamp; | 1301 initial_interaction_timestamp_ = interaction_timestamp; |
| 1300 } | 1302 } |
| 1301 } | 1303 } |
| 1302 | 1304 |
| 1303 } // namespace autofill | 1305 } // namespace autofill |
| OLD | NEW |