| 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/ui/autofill/tab_autofill_manager_delegate.h" | 5 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" | 9 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" |
| 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 dialog_controller_->TabActivated(); | 53 dialog_controller_->TabActivated(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 PersonalDataManager* TabAutofillManagerDelegate::GetPersonalDataManager() { | 56 PersonalDataManager* TabAutofillManagerDelegate::GetPersonalDataManager() { |
| 57 Profile* profile = | 57 Profile* profile = |
| 58 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 58 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
| 59 return PersonalDataManagerFactory::GetForProfile( | 59 return PersonalDataManagerFactory::GetForProfile( |
| 60 profile->GetOriginalProfile()); | 60 profile->GetOriginalProfile()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 scoped_refptr<AutofillWebDataService> |
| 64 TabAutofillManagerDelegate::GetDatabase() { |
| 65 return AutofillWebDataService::FromBrowserContext( |
| 66 web_contents_->GetBrowserContext()); |
| 67 } |
| 68 |
| 63 PrefService* TabAutofillManagerDelegate::GetPrefs() { | 69 PrefService* TabAutofillManagerDelegate::GetPrefs() { |
| 64 return Profile::FromBrowserContext(web_contents_->GetBrowserContext())-> | 70 return Profile::FromBrowserContext(web_contents_->GetBrowserContext())-> |
| 65 GetPrefs(); | 71 GetPrefs(); |
| 66 } | 72 } |
| 67 | 73 |
| 68 void TabAutofillManagerDelegate::ShowAutofillSettings() { | 74 void TabAutofillManagerDelegate::ShowAutofillSettings() { |
| 69 #if defined(OS_ANDROID) | 75 #if defined(OS_ANDROID) |
| 70 NOTIMPLEMENTED(); | 76 NOTIMPLEMENTED(); |
| 71 #else | 77 #else |
| 72 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); | 78 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 179 |
| 174 void TabAutofillManagerDelegate::DetectAccountCreationForms( | 180 void TabAutofillManagerDelegate::DetectAccountCreationForms( |
| 175 const std::vector<autofill::FormStructure*>& forms) { | 181 const std::vector<autofill::FormStructure*>& forms) { |
| 176 PasswordGenerationManager* manager = | 182 PasswordGenerationManager* manager = |
| 177 PasswordGenerationManager::FromWebContents(web_contents_); | 183 PasswordGenerationManager::FromWebContents(web_contents_); |
| 178 if (manager) | 184 if (manager) |
| 179 manager->DetectAccountCreationForms(forms); | 185 manager->DetectAccountCreationForms(forms); |
| 180 } | 186 } |
| 181 | 187 |
| 182 } // namespace autofill | 188 } // namespace autofill |
| OLD | NEW |