| 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "components/autofill/core/browser/autocomplete_history_manager.h" | 22 #include "components/autofill/core/browser/autocomplete_history_manager.h" |
| 23 #include "components/autofill/core/browser/autofill_client.h" | 23 #include "components/autofill/core/browser/autofill_client.h" |
| 24 #include "components/autofill/core/browser/autofill_download_manager.h" | 24 #include "components/autofill/core/browser/autofill_download_manager.h" |
| 25 #include "components/autofill/core/browser/autofill_driver.h" | 25 #include "components/autofill/core/browser/autofill_driver.h" |
| 26 #include "components/autofill/core/browser/autofill_metrics.h" |
| 26 #include "components/autofill/core/browser/card_unmask_delegate.h" | 27 #include "components/autofill/core/browser/card_unmask_delegate.h" |
| 27 #include "components/autofill/core/browser/form_structure.h" | 28 #include "components/autofill/core/browser/form_structure.h" |
| 28 #include "components/autofill/core/browser/personal_data_manager.h" | 29 #include "components/autofill/core/browser/personal_data_manager.h" |
| 29 #include "components/autofill/core/common/form_data.h" | 30 #include "components/autofill/core/common/form_data.h" |
| 30 | 31 |
| 31 namespace gfx { | 32 namespace gfx { |
| 32 class Rect; | 33 class Rect; |
| 33 class RectF; | 34 class RectF; |
| 34 } | 35 } |
| 35 | 36 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 void OnLoadedServerPredictions(const std::string& response_xml) override; | 225 void OnLoadedServerPredictions(const std::string& response_xml) override; |
| 225 | 226 |
| 226 // CardUnmaskDelegate: | 227 // CardUnmaskDelegate: |
| 227 void OnUnmaskResponse(const base::string16& cvc) override; | 228 void OnUnmaskResponse(const base::string16& cvc) override; |
| 228 void OnUnmaskPromptClosed() override; | 229 void OnUnmaskPromptClosed() override; |
| 229 | 230 |
| 230 // A toy method called when the (fake) unmasking process has finished. | 231 // A toy method called when the (fake) unmasking process has finished. |
| 231 void OnUnmaskVerificationResult(bool success); | 232 void OnUnmaskVerificationResult(bool success); |
| 232 | 233 |
| 233 // Returns false if Autofill is disabled or if no Autofill data is available. | 234 // Returns false if Autofill is disabled or if no Autofill data is available. |
| 234 bool RefreshDataModels() const; | 235 bool RefreshDataModels(); |
| 235 | 236 |
| 236 // Unpacks |unique_id| and fills |form_group| and |variant| with the | 237 // Unpacks |unique_id| and fills |form_group| and |variant| with the |
| 237 // appropriate data source and variant index. Sets |is_credit_card| to true | 238 // appropriate data source and variant index. Sets |is_credit_card| to true |
| 238 // if |data_model| points to a CreditCard data model, false if it's a | 239 // if |data_model| points to a CreditCard data model, false if it's a |
| 239 // profile data model. | 240 // profile data model. |
| 240 // Returns false if the unpacked id cannot be found. | 241 // Returns false if the unpacked id cannot be found. |
| 241 bool GetProfileOrCreditCard(int unique_id, | 242 bool GetProfileOrCreditCard(int unique_id, |
| 242 const AutofillDataModel** data_model, | 243 const AutofillDataModel** data_model, |
| 243 size_t* variant, | 244 size_t* variant, |
| 244 bool* is_credit_card) const WARN_UNUSED_RESULT; | 245 bool* is_credit_card) const WARN_UNUSED_RESULT; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 326 |
| 326 std::list<std::string> autofilled_form_signatures_; | 327 std::list<std::string> autofilled_form_signatures_; |
| 327 | 328 |
| 328 // Handles queries and uploads to Autofill servers. Will be NULL if | 329 // Handles queries and uploads to Autofill servers. Will be NULL if |
| 329 // the download manager functionality is disabled. | 330 // the download manager functionality is disabled. |
| 330 scoped_ptr<AutofillDownloadManager> download_manager_; | 331 scoped_ptr<AutofillDownloadManager> download_manager_; |
| 331 | 332 |
| 332 // Handles single-field autocomplete form data. | 333 // Handles single-field autocomplete form data. |
| 333 scoped_ptr<AutocompleteHistoryManager> autocomplete_history_manager_; | 334 scoped_ptr<AutocompleteHistoryManager> autocomplete_history_manager_; |
| 334 | 335 |
| 336 // Utilities for logging form events. |
| 337 scoped_ptr<AutofillMetrics::FormEventLogger> address_form_event_logger_; |
| 338 scoped_ptr<AutofillMetrics::FormEventLogger> credit_card_form_event_logger_; |
| 339 |
| 335 // Have we logged whether Autofill is enabled for this page load? | 340 // Have we logged whether Autofill is enabled for this page load? |
| 336 bool has_logged_autofill_enabled_; | 341 bool has_logged_autofill_enabled_; |
| 337 // Have we logged an address suggestions count metric for this page? | 342 // Have we logged an address suggestions count metric for this page? |
| 338 bool has_logged_address_suggestions_count_; | 343 bool has_logged_address_suggestions_count_; |
| 339 // Have we shown Autofill suggestions at least once? | 344 // Have we shown Autofill suggestions at least once? |
| 340 bool did_show_suggestions_; | 345 bool did_show_suggestions_; |
| 341 // Has the user manually edited at least one form field among the autofillable | 346 // Has the user manually edited at least one form field among the autofillable |
| 342 // ones? | 347 // ones? |
| 343 bool user_did_type_; | 348 bool user_did_type_; |
| 344 // Has the user autofilled a form on this page? | 349 // Has the user autofilled a form on this page? |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 412 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
| 408 AutocompleteOffRespected); | 413 AutocompleteOffRespected); |
| 409 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 414 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
| 410 AutocompleteOffRespectedWithFlag); | 415 AutocompleteOffRespectedWithFlag); |
| 411 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 416 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
| 412 }; | 417 }; |
| 413 | 418 |
| 414 } // namespace autofill | 419 } // namespace autofill |
| 415 | 420 |
| 416 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ | 421 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ |
| OLD | NEW |