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 #include "chrome/browser/autofill/autofill_manager.h" | 5 #include "chrome/browser/autofill/autofill_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <map> | 10 #include <map> |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "chrome/browser/autofill/phone_number.h" | 33 #include "chrome/browser/autofill/phone_number.h" |
34 #include "chrome/browser/autofill/phone_number_i18n.h" | 34 #include "chrome/browser/autofill/phone_number_i18n.h" |
35 #include "chrome/browser/autofill/select_control_handler.h" | 35 #include "chrome/browser/autofill/select_control_handler.h" |
36 #include "chrome/browser/infobars/infobar_tab_helper.h" | 36 #include "chrome/browser/infobars/infobar_tab_helper.h" |
37 #include "chrome/browser/password_manager/password_manager.h" | 37 #include "chrome/browser/password_manager/password_manager.h" |
38 #include "chrome/browser/prefs/pref_service.h" | 38 #include "chrome/browser/prefs/pref_service.h" |
39 #include "chrome/browser/profiles/profile.h" | 39 #include "chrome/browser/profiles/profile.h" |
40 #include "chrome/browser/sync/profile_sync_service_factory.h" | 40 #include "chrome/browser/sync/profile_sync_service_factory.h" |
41 #include "chrome/browser/sync/profile_sync_service.h" | 41 #include "chrome/browser/sync/profile_sync_service.h" |
42 #include "chrome/browser/ui/browser.h" | 42 #include "chrome/browser/ui/browser.h" |
43 #include "chrome/browser/ui/browser_list.h" | 43 #include "chrome/browser/ui/browser_finder.h" |
44 #include "chrome/browser/ui/browser_window.h" | 44 #include "chrome/browser/ui/browser_window.h" |
45 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 45 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
46 #include "chrome/common/autofill_messages.h" | 46 #include "chrome/common/autofill_messages.h" |
47 #include "chrome/common/chrome_notification_types.h" | 47 #include "chrome/common/chrome_notification_types.h" |
48 #include "chrome/common/chrome_switches.h" | 48 #include "chrome/common/chrome_switches.h" |
49 #include "chrome/common/guid.h" | 49 #include "chrome/common/guid.h" |
50 #include "chrome/common/pref_names.h" | 50 #include "chrome/common/pref_names.h" |
51 #include "chrome/common/url_constants.h" | 51 #include "chrome/common/url_constants.h" |
52 #include "content/public/browser/browser_thread.h" | 52 #include "content/public/browser/browser_thread.h" |
53 #include "content/public/browser/notification_service.h" | 53 #include "content/public/browser/notification_service.h" |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 autofilled_form_signatures_.pop_back(); | 628 autofilled_form_signatures_.pop_back(); |
629 | 629 |
630 host->Send(new AutofillMsg_FormDataFilled( | 630 host->Send(new AutofillMsg_FormDataFilled( |
631 host->GetRoutingID(), query_id, result)); | 631 host->GetRoutingID(), query_id, result)); |
632 } | 632 } |
633 | 633 |
634 void AutofillManager::OnShowAutofillDialog() { | 634 void AutofillManager::OnShowAutofillDialog() { |
635 #if defined(OS_ANDROID) | 635 #if defined(OS_ANDROID) |
636 NOTIMPLEMENTED(); | 636 NOTIMPLEMENTED(); |
637 #else | 637 #else |
638 Browser* browser = BrowserList::GetLastActiveWithProfile( | 638 Browser* browser = browser::FindLastActiveWithProfile( |
639 Profile::FromBrowserContext(web_contents()->GetBrowserContext())); | 639 Profile::FromBrowserContext(web_contents()->GetBrowserContext())); |
640 if (browser) | 640 if (browser) |
641 browser->ShowOptionsTab(chrome::kAutofillSubPage); | 641 browser->ShowOptionsTab(chrome::kAutofillSubPage); |
642 #endif // #if defined(OS_ANDROID) | 642 #endif // #if defined(OS_ANDROID) |
643 } | 643 } |
644 | 644 |
645 void AutofillManager::OnDidPreviewAutofillFormData() { | 645 void AutofillManager::OnDidPreviewAutofillFormData() { |
646 content::NotificationService::current()->Notify( | 646 content::NotificationService::current()->Notify( |
647 chrome::NOTIFICATION_AUTOFILL_DID_FILL_FORM_DATA, | 647 chrome::NOTIFICATION_AUTOFILL_DID_FILL_FORM_DATA, |
648 content::Source<RenderViewHost>(web_contents()->GetRenderViewHost()), | 648 content::Source<RenderViewHost>(web_contents()->GetRenderViewHost()), |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 | 684 |
685 void AutofillManager::OnHideAutofillPopup() { | 685 void AutofillManager::OnHideAutofillPopup() { |
686 if (external_delegate_) | 686 if (external_delegate_) |
687 external_delegate_->HideAutofillPopup(); | 687 external_delegate_->HideAutofillPopup(); |
688 } | 688 } |
689 | 689 |
690 void AutofillManager::OnShowPasswordGenerationPopup(const gfx::Rect& bounds) { | 690 void AutofillManager::OnShowPasswordGenerationPopup(const gfx::Rect& bounds) { |
691 #if defined(OS_ANDROID) | 691 #if defined(OS_ANDROID) |
692 NOTIMPLEMENTED(); | 692 NOTIMPLEMENTED(); |
693 #else | 693 #else |
694 Browser* browser = BrowserList::GetLastActiveWithProfile( | 694 Browser* browser = browser::FindLastActiveWithProfile( |
695 Profile::FromBrowserContext(web_contents()->GetBrowserContext())); | 695 Profile::FromBrowserContext(web_contents()->GetBrowserContext())); |
696 browser->window()->ShowPasswordGenerationBubble(bounds); | 696 browser->window()->ShowPasswordGenerationBubble(bounds); |
697 #endif // #if defined(OS_ANDROID) | 697 #endif // #if defined(OS_ANDROID) |
698 } | 698 } |
699 | 699 |
700 void AutofillManager::RemoveAutofillProfileOrCreditCard(int unique_id) { | 700 void AutofillManager::RemoveAutofillProfileOrCreditCard(int unique_id) { |
701 const std::vector<AutofillProfile*>& profiles = personal_data_->profiles(); | 701 const std::vector<AutofillProfile*>& profiles = personal_data_->profiles(); |
702 const std::vector<CreditCard*>& credit_cards = personal_data_->credit_cards(); | 702 const std::vector<CreditCard*>& credit_cards = personal_data_->credit_cards(); |
703 const AutofillProfile* profile = NULL; | 703 const AutofillProfile* profile = NULL; |
704 const CreditCard* credit_card = NULL; | 704 const CreditCard* credit_card = NULL; |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1351 *profile_guid = IDToGUID(profile_id); | 1351 *profile_guid = IDToGUID(profile_id); |
1352 } | 1352 } |
1353 | 1353 |
1354 void AutofillManager::UpdateInitialInteractionTimestamp( | 1354 void AutofillManager::UpdateInitialInteractionTimestamp( |
1355 const TimeTicks& interaction_timestamp) { | 1355 const TimeTicks& interaction_timestamp) { |
1356 if (initial_interaction_timestamp_.is_null() || | 1356 if (initial_interaction_timestamp_.is_null() || |
1357 interaction_timestamp < initial_interaction_timestamp_) { | 1357 interaction_timestamp < initial_interaction_timestamp_) { |
1358 initial_interaction_timestamp_ = interaction_timestamp; | 1358 initial_interaction_timestamp_ = interaction_timestamp; |
1359 } | 1359 } |
1360 } | 1360 } |
OLD | NEW |