OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_ |
6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_ | 6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 void Reset(); | 167 void Reset(); |
168 | 168 |
169 // Logs quality metrics for the |submitted_form| and uploads the form data | 169 // Logs quality metrics for the |submitted_form| and uploads the form data |
170 // to the crowdsourcing server, if appropriate. | 170 // to the crowdsourcing server, if appropriate. |
171 virtual void UploadFormDataAsyncCallback( | 171 virtual void UploadFormDataAsyncCallback( |
172 const FormStructure* submitted_form, | 172 const FormStructure* submitted_form, |
173 const base::TimeTicks& load_time, | 173 const base::TimeTicks& load_time, |
174 const base::TimeTicks& interaction_time, | 174 const base::TimeTicks& interaction_time, |
175 const base::TimeTicks& submission_time); | 175 const base::TimeTicks& submission_time); |
176 | 176 |
| 177 // Shows the Autocheckout bubble if conditions are right. See comments for |
| 178 // AutocheckoutManager::MaybeShowAutocheckoutBubble. Input element requesting |
| 179 // bubble belongs to |form|. |bounding_box| is the bounding box of the input |
| 180 // field in focus. |
| 181 virtual void OnMaybeShowAutocheckoutBubble(const FormData& form, |
| 182 const gfx::RectF& bounding_box); |
| 183 |
177 // Maps GUIDs to and from IDs that are used to identify profiles and credit | 184 // Maps GUIDs to and from IDs that are used to identify profiles and credit |
178 // cards sent to and from the renderer process. | 185 // cards sent to and from the renderer process. |
179 virtual int GUIDToID(const PersonalDataManager::GUIDPair& guid) const; | 186 virtual int GUIDToID(const PersonalDataManager::GUIDPair& guid) const; |
180 virtual const PersonalDataManager::GUIDPair IDToGUID(int id) const; | 187 virtual const PersonalDataManager::GUIDPair IDToGUID(int id) const; |
181 | 188 |
182 // Methods for packing and unpacking credit card and profile IDs for sending | 189 // Methods for packing and unpacking credit card and profile IDs for sending |
183 // and receiving to and from the renderer process. | 190 // and receiving to and from the renderer process. |
184 int PackGUIDs(const PersonalDataManager::GUIDPair& cc_guid, | 191 int PackGUIDs(const PersonalDataManager::GUIDPair& cc_guid, |
185 const PersonalDataManager::GUIDPair& profile_guid) const; | 192 const PersonalDataManager::GUIDPair& profile_guid) const; |
186 void UnpackGUIDs(int id, | 193 void UnpackGUIDs(int id, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 const GURL& frame_url); | 263 const GURL& frame_url); |
257 | 264 |
258 // Passes return data for an OnRequestAutocomplete call back to the page. | 265 // Passes return data for an OnRequestAutocomplete call back to the page. |
259 void ReturnAutocompleteData(const FormStructure* result, | 266 void ReturnAutocompleteData(const FormStructure* result, |
260 const std::string& unused_transaction_id); | 267 const std::string& unused_transaction_id); |
261 | 268 |
262 // Called to signal clicking an element failed in some way during an | 269 // Called to signal clicking an element failed in some way during an |
263 // Autocheckout flow. | 270 // Autocheckout flow. |
264 void OnClickFailed(autofill::AutocheckoutStatus status); | 271 void OnClickFailed(autofill::AutocheckoutStatus status); |
265 | 272 |
266 // Shows the Autocheckout bubble if conditions are right. See comments for | |
267 // AutocheckoutManager::MaybeShowAutocheckoutBubble. |source_url| is the site | |
268 // Autocheckout is being offered on. |ssl_status| is the SSL status of the | |
269 // page. |bounding_box| is the bounding box of the input field in focus. | |
270 void OnMaybeShowAutocheckoutBubble(const GURL& source_url, | |
271 const content::SSLStatus& ssl_status, | |
272 const gfx::RectF& bounding_box); | |
273 | |
274 // Returns the matched whitelist URL prefix for the current tab's url. | 273 // Returns the matched whitelist URL prefix for the current tab's url. |
275 virtual std::string GetAutocheckoutURLPrefix() const; | 274 virtual std::string GetAutocheckoutURLPrefix() const; |
276 | 275 |
277 // Fills |host| with the RenderViewHost for this tab. | 276 // Fills |host| with the RenderViewHost for this tab. |
278 // Returns false if Autofill is disabled or if the host is unavailable. | 277 // Returns false if Autofill is disabled or if the host is unavailable. |
279 bool GetHost(content::RenderViewHost** host) const WARN_UNUSED_RESULT; | 278 bool GetHost(content::RenderViewHost** host) const WARN_UNUSED_RESULT; |
280 | 279 |
281 // Unpacks |unique_id| and fills |form_group| and |variant| with the | 280 // Unpacks |unique_id| and fills |form_group| and |variant| with the |
282 // appropriate data source and variant index. Returns false if the unpacked | 281 // appropriate data source and variant index. Returns false if the unpacked |
283 // id cannot be found. | 282 // id cannot be found. |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, | 426 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, |
428 UserHappinessFormLoadAndSubmission); | 427 UserHappinessFormLoadAndSubmission); |
429 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); | 428 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); |
430 | 429 |
431 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 430 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
432 }; | 431 }; |
433 | 432 |
434 } // namespace autofill | 433 } // namespace autofill |
435 | 434 |
436 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_ | 435 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_MANAGER_H_ |
OLD | NEW |