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/core/browser/autofill_external_delegate.h" | 5 #include "components/autofill/core/browser/autofill_external_delegate.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 // Only preview the data if it is a profile. | 194 // Only preview the data if it is a profile. |
195 if (identifier > 0) | 195 if (identifier > 0) |
196 FillAutofillFormData(identifier, true); | 196 FillAutofillFormData(identifier, true); |
197 else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) | 197 else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) |
198 driver_->RendererShouldPreviewFieldWithValue(value); | 198 driver_->RendererShouldPreviewFieldWithValue(value); |
199 } | 199 } |
200 | 200 |
201 void AutofillExternalDelegate::DidAcceptSuggestion(const base::string16& value, | 201 void AutofillExternalDelegate::DidAcceptSuggestion(const base::string16& value, |
202 int identifier) { | 202 int identifier) { |
| 203 manager_->OnUserDidAcceptAutofillSuggestion(identifier); |
203 if (identifier == POPUP_ITEM_ID_AUTOFILL_OPTIONS) { | 204 if (identifier == POPUP_ITEM_ID_AUTOFILL_OPTIONS) { |
204 // User selected 'Autofill Options'. | 205 // User selected 'Autofill Options'. |
205 manager_->ShowAutofillSettings(); | 206 manager_->ShowAutofillSettings(); |
206 } else if (identifier == POPUP_ITEM_ID_CLEAR_FORM) { | 207 } else if (identifier == POPUP_ITEM_ID_CLEAR_FORM) { |
207 // User selected 'Clear form'. | 208 // User selected 'Clear form'. |
208 driver_->RendererShouldClearFilledForm(); | 209 driver_->RendererShouldClearFilledForm(); |
209 } else if (identifier == POPUP_ITEM_ID_PASSWORD_ENTRY) { | 210 } else if (identifier == POPUP_ITEM_ID_PASSWORD_ENTRY) { |
210 NOTREACHED(); // Should be handled elsewhere. | 211 NOTREACHED(); // Should be handled elsewhere. |
211 } else if (identifier == POPUP_ITEM_ID_DATALIST_ENTRY) { | 212 } else if (identifier == POPUP_ITEM_ID_DATALIST_ENTRY) { |
212 driver_->RendererShouldAcceptDataListSuggestion(value); | 213 driver_->RendererShouldAcceptDataListSuggestion(value); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } | 383 } |
383 } | 384 } |
384 | 385 |
385 #if defined(OS_MACOSX) && !defined(OS_IOS) | 386 #if defined(OS_MACOSX) && !defined(OS_IOS) |
386 void AutofillExternalDelegate::PingRenderer() { | 387 void AutofillExternalDelegate::PingRenderer() { |
387 driver_->PingRenderer(); | 388 driver_->PingRenderer(); |
388 } | 389 } |
389 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 390 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
390 | 391 |
391 } // namespace autofill | 392 } // namespace autofill |
OLD | NEW |