Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: chrome/browser/autofill/autofill_manager.cc

Issue 8490017: Setting up external delegate calls to allow a future delegate to handle autofill (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autofill/autofill_manager.cc
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc
index 575407d0fee0a9ecc63fb11c4017d4ca4041cd4b..fa1e75ef167d098b09753b207e8d5babbc13435c 100644
--- a/chrome/browser/autofill/autofill_manager.cc
+++ b/chrome/browser/autofill/autofill_manager.cc
@@ -311,6 +311,12 @@ bool AutofillManager::OnMessageReceived(const IPC::Message& message) {
OnDidFillAutofillFormData)
IPC_MESSAGE_HANDLER(AutofillHostMsg_DidShowAutofillSuggestions,
OnDidShowAutofillSuggestions)
+ IPC_MESSAGE_HANDLER(AutofillDelegateMsg_ShowAutofillSuggestions,
+ ShowAutofillSuggestions)
+ IPC_MESSAGE_HANDLER(AutofillDelegateMsg_AutofillElementBounds,
+ SetAutofillElementBounds)
+ IPC_MESSAGE_HANDLER(AutofillDelegateMsg_HideAutofillPopup,
+ HideAutofillPopup)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -673,6 +679,32 @@ void AutofillManager::OnDidShowAutofillSuggestions(bool is_new_popup) {
}
}
+void AutofillManager::ShowAutofillSuggestions(
+ int query_id,
+ const std::vector<string16>& autofill_values,
+ const std::vector<string16>& autofill_labels,
+ const std::vector<string16>& autofill_icons,
+ const std::vector<int>& autofill_unique_ids) {
+ external_delegate_->OnSuggestionsReturned(query_id,
+ autofill_values,
+ autofill_labels,
+ autofill_icons,
+ autofill_unique_ids);
+ external_delegate_->ShowAutofillPopup();
+}
+
+void AutofillManager::SetAutofillElementBounds(
+ int x,
+ int y,
+ int width,
+ int height) {
+ external_delegate_->SetAutofillElementBounds(gfx::Rect(x, y, width, height));
+}
+
+void AutofillManager::HideAutofillPopup() {
+ external_delegate_->HideAutofillPopup();
+}
+
void AutofillManager::OnLoadedServerPredictions(
const std::string& response_xml) {
// Parse and store the server predictions.

Powered by Google App Engine
This is Rietveld 408576698