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

Side by Side Diff: components/autofill/core/browser/personal_data_manager_mac.mm

Issue 575283003: mac: Don't show access Address Book prompt if user has any Autofill state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix another unit test. Fix some broken (unused) logic in that unit test. Created 6 years, 3 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 unified diff | Download patch
OLDNEW
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 #include "components/autofill/core/browser/personal_data_manager.h" 5 #include "components/autofill/core/browser/personal_data_manager.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #import <AddressBook/AddressBook.h> 9 #import <AddressBook/AddressBook.h>
10 10
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // profiles. 356 // profiles.
357 pref_service_->SetBoolean(prefs::kAutofillUseMacAddressBook, true); 357 pref_service_->SetBoolean(prefs::kAutofillUseMacAddressBook, true);
358 358
359 // Request permissions. 359 // Request permissions.
360 GetAddressBook(pref_service_); 360 GetAddressBook(pref_service_);
361 return true; 361 return true;
362 } 362 }
363 363
364 bool PersonalDataManager::ShouldShowAccessAddressBookSuggestion( 364 bool PersonalDataManager::ShouldShowAccessAddressBookSuggestion(
365 AutofillType type) { 365 AutofillType type) {
366 // Don't show the access Address Book prompt if the user has built up any
367 // Autofill state.
368 if (!web_profiles_.empty())
369 return false;
370
366 if (!enabled_pref_->GetValue()) 371 if (!enabled_pref_->GetValue())
367 return false; 372 return false;
368 373
369 if (HasPromptedForAccessToAddressBook(pref_service_)) 374 if (HasPromptedForAccessToAddressBook(pref_service_))
370 return false; 375 return false;
371 376
372 switch (type.group()) { 377 switch (type.group()) {
373 case ADDRESS_BILLING: 378 case ADDRESS_BILLING:
374 case ADDRESS_HOME: 379 case ADDRESS_HOME:
375 case EMAIL: 380 case EMAIL:
(...skipping 11 matching lines...) Expand all
387 } 392 }
388 393
389 return false; 394 return false;
390 } 395 }
391 396
392 void PersonalDataManager::BinaryChanging() { 397 void PersonalDataManager::BinaryChanging() {
393 g_binary_changed = true; 398 g_binary_changed = true;
394 } 399 }
395 400
396 } // namespace autofill 401 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698