Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc

Issue 71683003: Have AutofillManagerDelegate supply the AutofillWebDataService to core code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittests, respond to reviews Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698