| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 if (!host) | 126 if (!host) |
| 127 return; | 127 return; |
| 128 | 128 |
| 129 std::vector<FormDataPredictions> type_predictions; | 129 std::vector<FormDataPredictions> type_predictions; |
| 130 FormStructure::GetFieldTypePredictions(forms, &type_predictions); | 130 FormStructure::GetFieldTypePredictions(forms, &type_predictions); |
| 131 host->Send( | 131 host->Send( |
| 132 new AutofillMsg_FieldTypePredictionsAvailable(host->GetRoutingID(), | 132 new AutofillMsg_FieldTypePredictionsAvailable(host->GetRoutingID(), |
| 133 type_predictions)); | 133 type_predictions)); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void AutofillDriverImpl::RendererShouldClearForm() { | 136 void AutofillDriverImpl::RendererShouldClearFilledForm() { |
| 137 if (!RendererIsAvailable()) | 137 if (!RendererIsAvailable()) |
| 138 return; | 138 return; |
| 139 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); | 139 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); |
| 140 host->Send(new AutofillMsg_ClearForm(host->GetRoutingID())); | 140 host->Send(new AutofillMsg_ClearForm(host->GetRoutingID())); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void AutofillDriverImpl::RendererShouldClearPreviewedForm() { |
| 144 if (!RendererIsAvailable()) |
| 145 return; |
| 146 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); |
| 147 host->Send(new AutofillMsg_ClearPreviewedForm(host->GetRoutingID())); |
| 148 } |
| 149 |
| 143 bool AutofillDriverImpl::OnMessageReceived(const IPC::Message& message) { | 150 bool AutofillDriverImpl::OnMessageReceived(const IPC::Message& message) { |
| 144 bool handled = true; | 151 bool handled = true; |
| 145 IPC_BEGIN_MESSAGE_MAP(AutofillDriverImpl, message) | 152 IPC_BEGIN_MESSAGE_MAP(AutofillDriverImpl, message) |
| 146 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormsSeen, autofill_manager_.get(), | 153 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormsSeen, autofill_manager_.get(), |
| 147 AutofillManager::OnFormsSeen) | 154 AutofillManager::OnFormsSeen) |
| 148 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormSubmitted, autofill_manager_.get(), | 155 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormSubmitted, autofill_manager_.get(), |
| 149 AutofillManager::OnFormSubmitted) | 156 AutofillManager::OnFormSubmitted) |
| 150 IPC_MESSAGE_FORWARD(AutofillHostMsg_TextFieldDidChange, | 157 IPC_MESSAGE_FORWARD(AutofillHostMsg_TextFieldDidChange, |
| 151 autofill_manager_.get(), | 158 autofill_manager_.get(), |
| 152 AutofillManager::OnTextFieldDidChange) | 159 AutofillManager::OnTextFieldDidChange) |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 if (!*content::Details<bool>(details).ptr()) | 231 if (!*content::Details<bool>(details).ptr()) |
| 225 autofill_manager_->delegate()->HideAutofillPopup(); | 232 autofill_manager_->delegate()->HideAutofillPopup(); |
| 226 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { | 233 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { |
| 227 autofill_manager_->delegate()->HideAutofillPopup(); | 234 autofill_manager_->delegate()->HideAutofillPopup(); |
| 228 } else { | 235 } else { |
| 229 NOTREACHED(); | 236 NOTREACHED(); |
| 230 } | 237 } |
| 231 } | 238 } |
| 232 | 239 |
| 233 } // namespace autofill | 240 } // namespace autofill |
| OLD | NEW |