OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/personal_data_manager.h" | 5 #include "chrome/browser/autofill/personal_data_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 return !password_hash_.empty(); | 398 return !password_hash_.empty(); |
399 } | 399 } |
400 | 400 |
401 const std::vector<AutoFillProfile*>& PersonalDataManager::profiles() { | 401 const std::vector<AutoFillProfile*>& PersonalDataManager::profiles() { |
402 // |profile_| is NULL in AutoFillManagerTest. | 402 // |profile_| is NULL in AutoFillManagerTest. |
403 if (!profile_) | 403 if (!profile_) |
404 return web_profiles_.get(); | 404 return web_profiles_.get(); |
405 | 405 |
406 bool auxiliary_profiles_enabled = profile_->GetPrefs()->GetBoolean( | 406 bool auxiliary_profiles_enabled = profile_->GetPrefs()->GetBoolean( |
407 prefs::kAutoFillAuxiliaryProfilesEnabled); | 407 prefs::kAutoFillAuxiliaryProfilesEnabled); |
| 408 |
| 409 #if !defined(OS_MACOSX) |
| 410 DCHECK(!auxiliary_profiles_enabled) |
| 411 << "Auxiliary profiles supported on Mac only"; |
| 412 #endif |
| 413 |
408 if (auxiliary_profiles_enabled) { | 414 if (auxiliary_profiles_enabled) { |
409 profiles_.clear(); | 415 profiles_.clear(); |
410 | 416 |
411 // Populates |auxiliary_profiles_|. | 417 // Populates |auxiliary_profiles_|. |
412 LoadAuxiliaryProfiles(); | 418 LoadAuxiliaryProfiles(); |
413 | 419 |
414 profiles_.insert(profiles_.end(), | 420 profiles_.insert(profiles_.end(), |
415 web_profiles_.begin(), web_profiles_.end()); | 421 web_profiles_.begin(), web_profiles_.end()); |
416 profiles_.insert(profiles_.end(), | 422 profiles_.insert(profiles_.end(), |
417 auxiliary_profiles_.begin(), auxiliary_profiles_.end()); | 423 auxiliary_profiles_.begin(), auxiliary_profiles_.end()); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 } | 638 } |
633 | 639 |
634 profiles.push_back(**iter); | 640 profiles.push_back(**iter); |
635 } | 641 } |
636 | 642 |
637 if (!merged) | 643 if (!merged) |
638 profiles.push_back(*imported_profile_); | 644 profiles.push_back(*imported_profile_); |
639 | 645 |
640 SetProfiles(&profiles); | 646 SetProfiles(&profiles); |
641 } | 647 } |
OLD | NEW |