OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/content_autofill_driver.h" | 5 #include "components/autofill/content/browser/content_autofill_driver.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
9 #include "components/autofill/content/common/autofill_messages.h" | 9 #include "components/autofill/content/common/autofill_messages.h" |
10 #include "components/autofill/core/browser/autofill_external_delegate.h" | 10 #include "components/autofill/core/browser/autofill_external_delegate.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 if (!RendererIsAvailable()) | 117 if (!RendererIsAvailable()) |
118 return; | 118 return; |
119 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); | 119 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); |
120 | 120 |
121 std::vector<FormDataPredictions> type_predictions; | 121 std::vector<FormDataPredictions> type_predictions; |
122 FormStructure::GetFieldTypePredictions(forms, &type_predictions); | 122 FormStructure::GetFieldTypePredictions(forms, &type_predictions); |
123 host->Send(new AutofillMsg_FieldTypePredictionsAvailable(host->GetRoutingID(), | 123 host->Send(new AutofillMsg_FieldTypePredictionsAvailable(host->GetRoutingID(), |
124 type_predictions)); | 124 type_predictions)); |
125 } | 125 } |
126 | 126 |
| 127 void ContentAutofillDriver::RemovePasswordAutofillSuggestion( |
| 128 const base::string16& username_to_remove) { |
| 129 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); |
| 130 if (!host) |
| 131 return; |
| 132 |
| 133 autofill_manager_->set_username_to_remove(username_to_remove); |
| 134 host->Send(new AutofillMsg_RemoveSavedPassword(host->GetRoutingID())); |
| 135 } |
| 136 |
127 void ContentAutofillDriver::RendererShouldAcceptDataListSuggestion( | 137 void ContentAutofillDriver::RendererShouldAcceptDataListSuggestion( |
128 const base::string16& value) { | 138 const base::string16& value) { |
129 if (!RendererIsAvailable()) | 139 if (!RendererIsAvailable()) |
130 return; | 140 return; |
131 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); | 141 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); |
132 host->Send( | 142 host->Send( |
133 new AutofillMsg_AcceptDataListSuggestion(host->GetRoutingID(), value)); | 143 new AutofillMsg_AcceptDataListSuggestion(host->GetRoutingID(), value)); |
134 } | 144 } |
135 | 145 |
136 void ContentAutofillDriver::RendererShouldAcceptPasswordAutofillSuggestion( | 146 void ContentAutofillDriver::RendererShouldAcceptPasswordAutofillSuggestion( |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 void ContentAutofillDriver::NavigationEntryCommitted( | 245 void ContentAutofillDriver::NavigationEntryCommitted( |
236 const content::LoadCommittedDetails& load_details) { | 246 const content::LoadCommittedDetails& load_details) { |
237 autofill_manager_->delegate()->HideAutofillPopup(); | 247 autofill_manager_->delegate()->HideAutofillPopup(); |
238 } | 248 } |
239 | 249 |
240 void ContentAutofillDriver::WasHidden() { | 250 void ContentAutofillDriver::WasHidden() { |
241 autofill_manager_->delegate()->HideAutofillPopup(); | 251 autofill_manager_->delegate()->HideAutofillPopup(); |
242 } | 252 } |
243 | 253 |
244 } // namespace autofill | 254 } // namespace autofill |
OLD | NEW |