17d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Multiply-included message file, hence no include guard. 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string> 8a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch#include <vector> 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 10a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch#include "base/strings/string16.h" 11eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "base/time/time.h" 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "components/autofill/content/common/autofill_param_traits_macros.h" 137d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "components/autofill/core/common/form_data.h" 147d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "components/autofill/core/common/form_data_predictions.h" 157d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "components/autofill/core/common/form_field_data.h" 167d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "components/autofill/core/common/form_field_data_predictions.h" 1758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#include "components/autofill/core/common/password_form.h" 187d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "components/autofill/core/common/password_form_fill_data.h" 197d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "components/autofill/core/common/web_element_descriptor.h" 20c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#include "content/public/common/common_param_traits.h" 212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "content/public/common/common_param_traits_macros.h" 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_message_macros.h" 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_message_utils.h" 24eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "third_party/WebKit/public/web/WebFormElement.h" 25116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#include "ui/gfx/ipc/gfx_param_traits.h" 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/rect.h" 27a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch#include "url/gurl.h" 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define IPC_MESSAGE_START AutofillMsgStart 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 317d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)IPC_ENUM_TRAITS_MAX_VALUE(base::i18n::TextDirection, 327d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) base::i18n::TEXT_DIRECTION_NUM_DIRECTIONS - 1) 332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(autofill::WebElementDescriptor) 352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(descriptor) 362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(retrieval_method) 372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_TRAITS_END() 382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 393551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_ENUM_TRAITS_MAX_VALUE(autofill::WebElementDescriptor::RetrievalMethod, 403551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) autofill::WebElementDescriptor::NONE) 412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 42c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(autofill::FormFieldData) 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(label) 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(name) 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(value) 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(form_control_type) 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(autocomplete_attribute) 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(max_length) 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(is_autofilled) 502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(is_checked) 512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(is_checkable) 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(is_focusable) 535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(should_autocomplete) 547d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(text_direction) 555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(option_values) 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(option_contents) 575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 59c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(autofill::FormFieldDataPredictions) 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(field) 615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(signature) 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(heuristic_type) 635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(server_type) 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(overall_type) 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 67c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(autofill::FormDataPredictions) 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(data) 695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(signature) 705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(experiment_id) 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(fields) 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 74868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(autofill::UsernamesCollectionKey) 75868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(username) 76868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(password) 77868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 78868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 79c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_STRUCT_TRAITS_BEGIN(autofill::PasswordFormFillData) 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(basic_data) 81eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch IPC_STRUCT_TRAITS_MEMBER(preferred_realm) 825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(additional_logins) 83868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(other_possible_usernames) 845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_STRUCT_TRAITS_MEMBER(wait_for_username) 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_TRAITS_END() 865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 87eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_STRUCT_TRAITS_BEGIN(autofill::PasswordAndRealm) 88eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch IPC_STRUCT_TRAITS_MEMBER(password) 89eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch IPC_STRUCT_TRAITS_MEMBER(realm) 90eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_STRUCT_TRAITS_END() 91eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch 923551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_ENUM_TRAITS_MAX_VALUE( 93f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebFormElement::AutocompleteResult, 94f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebFormElement::AutocompleteResultErrorInvalid) 955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Autofill messages sent from the browser to the renderer. 975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 9846d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)// Instructs the renderer to immediately return an IPC acknowledging the ping. 9946d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)// This is used to correctly sequence events, since IPCs are guaranteed to be 10046d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)// processed in order. 10146d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)IPC_MESSAGE_ROUTED0(AutofillMsg_Ping) 10246d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) 103a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Instructs the renderer to fill the active form with the given form data. 104a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AutofillMsg_FillForm, 105a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) int /* query_id */, 106a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) autofill::FormData /* form */) 107a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 108a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Instructs the renderer to preview the active form with the given form data. 109a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AutofillMsg_PreviewForm, 110a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) int /* query_id */, 111a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) autofill::FormData /* form */) 1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Fill a password form and prepare field autocomplete for multiple 1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// matching logins. Lets the renderer know if it should disable the popup 1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// because the browser process will own the popup UI. 116eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_MESSAGE_ROUTED1(AutofillMsg_FillPasswordForm, 117eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch autofill::PasswordFormFillData /* the fill form data*/) 1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1195c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// Notification to start (|active| == true) or stop (|active| == false) logging 1205c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// the decisions made about saving the password. 1216d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AutofillMsg_SetLoggingState, bool /* active */) 1225c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu 1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send the heuristic and server field type predictions to the renderer. 1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1( 1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) AutofillMsg_FieldTypePredictionsAvailable, 126c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) std::vector<autofill::FormDataPredictions> /* forms */) 1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Clears the currently displayed Autofill results. 1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AutofillMsg_ClearForm) 1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the renderer that the Autofill previewed form should be cleared. 1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AutofillMsg_ClearPreviewedForm) 1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sets the currently selected node's value. 135a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AutofillMsg_FillFieldWithValue, 136a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) base::string16 /* value */) 137a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 138a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Sets the suggested value for the currently previewed node. 139a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AutofillMsg_PreviewFieldWithValue, 140a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) base::string16 /* value */) 1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sets the currently selected node's value to be the given data list value. 1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AutofillMsg_AcceptDataListSuggestion, 144c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) base::string16 /* accepted data list value */) 1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the renderer to populate the correct password fields with this 1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// generated password. 1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AutofillMsg_GeneratedPasswordAccepted, 149c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) base::string16 /* generated_password */) 1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 151cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Tells the renderer to fill the username and password with with given 152cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// values. 153cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AutofillMsg_FillPasswordSuggestion, 154cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) base::string16 /* username */, 155cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) base::string16 /* password */) 156cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 157cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Tells the renderer to preview the username and password with the given 158cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// values. 159cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AutofillMsg_PreviewPasswordSuggestion, 1605c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu base::string16 /* username */, 1615c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu base::string16 /* password */) 1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the renderer that this password form is not blacklisted. A form can 1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// be blacklisted if a user chooses "never save passwords for this site". 1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AutofillMsg_FormNotBlacklisted, 16658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) autofill::PasswordForm /* form checked */) 1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1682a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Sent when requestAutocomplete() finishes (either succesfully or with an 1692a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// error). If it was a success, the renderer fills the form that requested 170a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch// autocomplete with the |form_data| values input by the user. |message| 171a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch// is printed to the console if non-empty. 172a02191e04bc25c4935f804f2c080ae28663d096dBen MurdochIPC_MESSAGE_ROUTED3(AutofillMsg_RequestAutocompleteResult, 173f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebFormElement::AutocompleteResult /* result */, 174a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch base::string16 /* message */, 175c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) autofill::FormData /* form_data */) 1762a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 17758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// Sent when Autofill manager gets the query response from the Autofill server 17858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// and there are fields classified as ACCOUNT_CREATION_PASSWORD in the response. 17958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)IPC_MESSAGE_ROUTED1(AutofillMsg_AccountCreationFormsDetected, 18058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) std::vector<autofill::FormData> /* forms */) 18158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Autofill messages sent from the renderer to the browser. 1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1842a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// TODO(creis): check in the browser that the renderer actually has permission 1852a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// for the URL to avoid compromised renderers talking to the browser. 1862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Notification that forms have been seen that are candidates for 1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// filling/submitting by the AutofillManager. 189cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AutofillHostMsg_FormsSeen, 190c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) std::vector<autofill::FormData> /* forms */, 191cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) base::TimeTicks /* timestamp */) 1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Notification that password forms have been seen that are candidates for 1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// filling/submitting by the password manager. 1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsParsed, 19658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) std::vector<autofill::PasswordForm> /* forms */) 1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Notification that initial layout has occurred and the following password 199116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// forms are visible on the page (e.g. not set to display:none.), and whether 200116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// all frames in the page have been rendered. 201116680a4aac90f2aa7413d9095a592090648e557Ben MurdochIPC_MESSAGE_ROUTED2(AutofillHostMsg_PasswordFormsRendered, 202116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch std::vector<autofill::PasswordForm> /* forms */, 203116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch bool /* did_stop_loading */) 2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2056d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)// A ping to the browser that PasswordAutofillAgent was constructed. As a 2066d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)// consequence, the browser sends AutofillMsg_SetLoggingState with the current 2076d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)// state of the logging activity. 208116680a4aac90f2aa7413d9095a592090648e557Ben MurdochIPC_MESSAGE_ROUTED0(AutofillHostMsg_PasswordAutofillAgentConstructed) 2096d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles) 2103551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Notification that this password form was submitted by the user. 2113551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormSubmitted, 21258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) autofill::PasswordForm /* form */) 2133551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 2140529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch// Sends |log| to browser for displaying to the user. Only strings passed as an 2150529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch// argument to methods overriding SavePasswordProgressLogger::SendLog may become 2160529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch// |log|, because those are guaranteed to be sanitized. Never pass a free-form 2170529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch// string as |log|. 218a02191e04bc25c4935f804f2c080ae28663d096dBen MurdochIPC_MESSAGE_ROUTED1(AutofillHostMsg_RecordSavePasswordProgress, 219a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch std::string /* log */) 220a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 2215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Notification that a form has been submitted. The user hit the button. 2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AutofillHostMsg_FormSubmitted, 223c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) autofill::FormData /* form */, 2245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) base::TimeTicks /* timestamp */) 2255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Notification that a form field's value has changed. 2275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AutofillHostMsg_TextFieldDidChange, 228c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) autofill::FormData /* the form */, 229c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) autofill::FormFieldData /* the form field */, 2305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) base::TimeTicks /* timestamp */) 2315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Queries the browser for Autofill suggestions for a form input field. 2335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED5(AutofillHostMsg_QueryFormFieldAutofill, 2345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int /* id of this message */, 235c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) autofill::FormData /* the form */, 236c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) autofill::FormFieldData /* the form field */, 2372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) gfx::RectF /* input field bounds, window-relative */, 2385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool /* display warning if autofill disabled */) 2395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent when a form is previewed with Autofill suggestions. 2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidPreviewAutofillFormData) 2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 24346d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)// Sent immediately after the renderer receives a ping IPC. 24446d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)IPC_MESSAGE_ROUTED0(AutofillHostMsg_PingAck) 24546d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) 2465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent when a form is filled with Autofill suggestions. 2475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(AutofillHostMsg_DidFillAutofillFormData, 2485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) base::TimeTicks /* timestamp */) 2495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Sent when a form receives a request to do interactive autocomplete. 2512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED2(AutofillHostMsg_RequestAutocomplete, 252c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) autofill::FormData /* form_data */, 2532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) GURL /* frame_url */) 2545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 25523730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)// Sent when interactive autocomplete is cancelled (e.g. because the invoking 25623730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles)// frame was navigated to a different URL). 257116680a4aac90f2aa7413d9095a592090648e557Ben MurdochIPC_MESSAGE_ROUTED0(AutofillHostMsg_CancelRequestAutocomplete) 25823730a6e56a168d1879203e4b3819bb36e3d8f1fTorne (Richard Coles) 2595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Send when a text field is done editing. 2605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidEndTextFieldEditing) 2615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 262a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Instructs the browser to hide the Autofill popup if it is open. 263a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AutofillHostMsg_HidePopup) 2642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 2655d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Instructs the browser to show the password generation popup at the 2665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// specified location. This location should be specified in the renderers 2675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// coordinate system. Form is the form associated with the password field. 2685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED3(AutofillHostMsg_ShowPasswordGenerationPopup, 2695d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) gfx::RectF /* source location */, 2705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int /* max length of the password */, 27158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) autofill::PasswordForm) 2725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2735d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Instructs the browser to show the popup for editing a generated password. 2745d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// The location should be specified in the renderers coordinate system. Form 2755d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// is the form associated with the password field. 2765d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AutofillHostMsg_ShowPasswordEditingPopup, 2775d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) gfx::RectF /* source location */, 2785d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) autofill::PasswordForm) 2795d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 2805d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Instructs the browser to hide any password generation popups. 2815d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)IPC_MESSAGE_ROUTED0(AutofillHostMsg_HidePasswordGenerationPopup) 2825d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 2835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Instruct the browser that a password mapping has been found for a field. 2845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(AutofillHostMsg_AddPasswordFormMapping, 285c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) autofill::FormFieldData, /* the user name field */ 286c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) autofill::PasswordFormFillData /* password pairings */) 2875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Instruct the browser to show a popup with the following suggestions from the 2895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// password manager. 290eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_MESSAGE_ROUTED4(AutofillHostMsg_ShowPasswordSuggestions, 291c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) autofill::FormFieldData /* the form field */, 2922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) gfx::RectF /* input field bounds, window-relative */, 293eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch std::vector<base::string16> /* suggestions */, 294eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch std::vector<base::string16> /* realms */) 2955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inform browser of data list values for the curent field. 297ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben MurdochIPC_MESSAGE_ROUTED2(AutofillHostMsg_SetDataList, 298c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) std::vector<base::string16> /* values */, 299ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch std::vector<base::string16> /* labels */) 300