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

Unified Diff: components/autofill/browser/personal_data_manager.cc

Issue 14392005: Allowing PersonalDataManagerFactory to create a service while incognito. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/browser/personal_data_manager.cc
diff --git a/components/autofill/browser/personal_data_manager.cc b/components/autofill/browser/personal_data_manager.cc
index 1e4d30c2a9a208e8ece39fd0a5733fe2b3415fbb..34f00efc9ef1c94af0a94d9fbf6405af09c76b93 100644
--- a/components/autofill/browser/personal_data_manager.cc
+++ b/components/autofill/browser/personal_data_manager.cc
@@ -142,7 +142,9 @@ PersonalDataManager::PersonalDataManager(const std::string& app_locale)
void PersonalDataManager::Init(BrowserContext* browser_context) {
browser_context_ = browser_context;
- metric_logger_->LogIsAutofillEnabledAtStartup(IsAutofillEnabled());
+
+ if (!browser_context_->IsOffTheRecord())
+ metric_logger_->LogIsAutofillEnabledAtStartup(IsAutofillEnabled());
scoped_refptr<AutofillWebDataService> autofill_data(
AutofillWebDataService::FromBrowserContext(browser_context_));
@@ -936,12 +938,8 @@ void PersonalDataManager::CancelPendingQuery(
void PersonalDataManager::SaveImportedProfile(
const AutofillProfile& imported_profile) {
- if (browser_context_->IsOffTheRecord()) {
- // The |IsOffTheRecord| check should happen earlier in the import process,
- // upon form submission.
- NOTREACHED();
+ if (browser_context_->IsOffTheRecord())
return;
- }
// Don't save a web profile if the data in the profile is a subset of an
// auxiliary profile.
@@ -961,12 +959,8 @@ void PersonalDataManager::SaveImportedProfile(
void PersonalDataManager::SaveImportedCreditCard(
const CreditCard& imported_card) {
DCHECK(!imported_card.number().empty());
- if (browser_context_->IsOffTheRecord()) {
- // The |IsOffTheRecord| check should happen earlier in the import process,
- // upon form submission.
- NOTREACHED();
+ if (browser_context_->IsOffTheRecord())
return;
- }
// Set to true if |imported_card| is merged into the credit card list.
bool merged = false;

Powered by Google App Engine
This is Rietveld 408576698