OLD | NEW |
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/content/browser/autofill_driver_impl.h" | 5 #include "components/autofill/content/browser/autofill_driver_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "components/autofill/core/browser/autofill_external_delegate.h" | 8 #include "components/autofill/core/browser/autofill_external_delegate.h" |
9 #include "components/autofill/core/browser/autofill_manager.h" | 9 #include "components/autofill/core/browser/autofill_manager.h" |
10 #include "components/autofill/core/browser/autofill_manager_delegate.h" | 10 #include "components/autofill/core/browser/autofill_manager_delegate.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 const std::string& app_locale, | 37 const std::string& app_locale, |
38 AutofillManager::AutofillDownloadManagerState enable_download_manager) { | 38 AutofillManager::AutofillDownloadManagerState enable_download_manager) { |
39 if (FromWebContents(contents)) | 39 if (FromWebContents(contents)) |
40 return; | 40 return; |
41 | 41 |
42 contents->SetUserData(kAutofillDriverImplWebContentsUserDataKey, | 42 contents->SetUserData(kAutofillDriverImplWebContentsUserDataKey, |
43 new AutofillDriverImpl(contents, | 43 new AutofillDriverImpl(contents, |
44 delegate, | 44 delegate, |
45 app_locale, | 45 app_locale, |
46 enable_download_manager)); | 46 enable_download_manager)); |
47 // Trigger the lazy creation of AutocheckoutWhitelistManagerService, and | |
48 // schedule a fetch of the Autocheckout whitelist file if it's not already | |
49 // loaded. This helps ensure that the whitelist will be available by the time | |
50 // the user navigates to a form on which Autocheckout should be enabled. | |
51 delegate->GetAutocheckoutWhitelistManager(); | |
52 } | 47 } |
53 | 48 |
54 // static | 49 // static |
55 AutofillDriverImpl* AutofillDriverImpl::FromWebContents( | 50 AutofillDriverImpl* AutofillDriverImpl::FromWebContents( |
56 content::WebContents* contents) { | 51 content::WebContents* contents) { |
57 return static_cast<AutofillDriverImpl*>( | 52 return static_cast<AutofillDriverImpl*>( |
58 contents->GetUserData(kAutofillDriverImplWebContentsUserDataKey)); | 53 contents->GetUserData(kAutofillDriverImplWebContentsUserDataKey)); |
59 } | 54 } |
60 | 55 |
61 AutofillDriverImpl::AutofillDriverImpl( | 56 AutofillDriverImpl::AutofillDriverImpl( |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 autofill_manager_.get(), | 176 autofill_manager_.get(), |
182 AutofillManager::OnAddPasswordFormMapping) | 177 AutofillManager::OnAddPasswordFormMapping) |
183 IPC_MESSAGE_FORWARD(AutofillHostMsg_ShowPasswordSuggestions, | 178 IPC_MESSAGE_FORWARD(AutofillHostMsg_ShowPasswordSuggestions, |
184 autofill_manager_.get(), | 179 autofill_manager_.get(), |
185 AutofillManager::OnShowPasswordSuggestions) | 180 AutofillManager::OnShowPasswordSuggestions) |
186 IPC_MESSAGE_FORWARD(AutofillHostMsg_SetDataList, autofill_manager_.get(), | 181 IPC_MESSAGE_FORWARD(AutofillHostMsg_SetDataList, autofill_manager_.get(), |
187 AutofillManager::OnSetDataList) | 182 AutofillManager::OnSetDataList) |
188 IPC_MESSAGE_FORWARD(AutofillHostMsg_RequestAutocomplete, | 183 IPC_MESSAGE_FORWARD(AutofillHostMsg_RequestAutocomplete, |
189 autofill_manager_.get(), | 184 autofill_manager_.get(), |
190 AutofillManager::OnRequestAutocomplete) | 185 AutofillManager::OnRequestAutocomplete) |
191 IPC_MESSAGE_FORWARD(AutofillHostMsg_AutocheckoutPageCompleted, | |
192 autofill_manager_.get(), | |
193 AutofillManager::OnAutocheckoutPageCompleted) | |
194 IPC_MESSAGE_FORWARD(AutofillHostMsg_MaybeShowAutocheckoutBubble, | |
195 autofill_manager_.get(), | |
196 AutofillManager::OnMaybeShowAutocheckoutBubble) | |
197 IPC_MESSAGE_UNHANDLED(handled = false) | 186 IPC_MESSAGE_UNHANDLED(handled = false) |
198 IPC_END_MESSAGE_MAP() | 187 IPC_END_MESSAGE_MAP() |
199 return handled; | 188 return handled; |
200 } | 189 } |
201 | 190 |
202 void AutofillDriverImpl::DidNavigateMainFrame( | 191 void AutofillDriverImpl::DidNavigateMainFrame( |
203 const content::LoadCommittedDetails& details, | 192 const content::LoadCommittedDetails& details, |
204 const content::FrameNavigateParams& params) { | 193 const content::FrameNavigateParams& params) { |
205 if (details.is_navigation_to_different_page()) | 194 if (details.is_navigation_to_different_page()) |
206 autofill_manager_->Reset(); | 195 autofill_manager_->Reset(); |
(...skipping 19 matching lines...) Expand all Loading... |
226 if (!*content::Details<bool>(details).ptr()) | 215 if (!*content::Details<bool>(details).ptr()) |
227 autofill_manager_->delegate()->HideAutofillPopup(); | 216 autofill_manager_->delegate()->HideAutofillPopup(); |
228 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { | 217 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { |
229 autofill_manager_->delegate()->HideAutofillPopup(); | 218 autofill_manager_->delegate()->HideAutofillPopup(); |
230 } else { | 219 } else { |
231 NOTREACHED(); | 220 NOTREACHED(); |
232 } | 221 } |
233 } | 222 } |
234 | 223 |
235 } // namespace autofill | 224 } // namespace autofill |
OLD | NEW |