| 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/autofill/autofill_manager.h" | 5 #include "chrome/browser/autofill/autofill_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "chrome/browser/autofill/password_generator.h" | 32 #include "chrome/browser/autofill/password_generator.h" |
| 33 #include "chrome/browser/autofill/personal_data_manager.h" | 33 #include "chrome/browser/autofill/personal_data_manager.h" |
| 34 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 34 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 35 #include "chrome/browser/autofill/phone_number.h" | 35 #include "chrome/browser/autofill/phone_number.h" |
| 36 #include "chrome/browser/autofill/phone_number_i18n.h" | 36 #include "chrome/browser/autofill/phone_number_i18n.h" |
| 37 #include "chrome/browser/autofill/select_control_handler.h" | 37 #include "chrome/browser/autofill/select_control_handler.h" |
| 38 #include "chrome/browser/infobars/infobar_tab_helper.h" | 38 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 39 #include "chrome/browser/password_manager/password_manager.h" | 39 #include "chrome/browser/password_manager/password_manager.h" |
| 40 #include "chrome/browser/prefs/pref_service.h" | 40 #include "chrome/browser/prefs/pref_service.h" |
| 41 #include "chrome/browser/profiles/profile.h" | 41 #include "chrome/browser/profiles/profile.h" |
| 42 #include "chrome/browser/sync/profile_sync_service.h" |
| 42 #include "chrome/browser/sync/profile_sync_service_factory.h" | 43 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 43 #include "chrome/browser/sync/profile_sync_service.h" | |
| 44 #include "chrome/browser/ui/browser.h" | 44 #include "chrome/browser/ui/browser.h" |
| 45 #include "chrome/browser/ui/browser_finder.h" | 45 #include "chrome/browser/ui/browser_finder.h" |
| 46 #include "chrome/browser/ui/browser_window.h" | 46 #include "chrome/browser/ui/browser_window.h" |
| 47 #include "chrome/browser/ui/chrome_pages.h" | 47 #include "chrome/browser/ui/chrome_pages.h" |
| 48 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 48 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 49 #include "chrome/common/autofill_messages.h" | 49 #include "chrome/common/autofill_messages.h" |
| 50 #include "chrome/common/chrome_notification_types.h" | 50 #include "chrome/common/chrome_notification_types.h" |
| 51 #include "chrome/common/chrome_switches.h" | 51 #include "chrome/common/chrome_switches.h" |
| 52 #include "chrome/common/pref_names.h" | 52 #include "chrome/common/pref_names.h" |
| 53 #include "chrome/common/url_constants.h" | 53 #include "chrome/common/url_constants.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 // (2) Password manager is enabled, and | 250 // (2) Password manager is enabled, and |
| 251 // (3) Password generation preference check box is checked. | 251 // (3) Password generation preference check box is checked. |
| 252 void AutofillManager::UpdatePasswordGenerationState( | 252 void AutofillManager::UpdatePasswordGenerationState( |
| 253 content::RenderViewHost* host, | 253 content::RenderViewHost* host, |
| 254 bool new_renderer) { | 254 bool new_renderer) { |
| 255 ProfileSyncService* service = ProfileSyncServiceFactory::GetForProfile( | 255 ProfileSyncService* service = ProfileSyncServiceFactory::GetForProfile( |
| 256 tab_contents_->profile()); | 256 tab_contents_->profile()); |
| 257 | 257 |
| 258 bool password_sync_enabled = false; | 258 bool password_sync_enabled = false; |
| 259 if (service) { | 259 if (service) { |
| 260 syncable::ModelTypeSet sync_set = service->GetPreferredDataTypes(); | 260 syncer::ModelTypeSet sync_set = service->GetPreferredDataTypes(); |
| 261 password_sync_enabled = | 261 password_sync_enabled = |
| 262 service->HasSyncSetupCompleted() && | 262 service->HasSyncSetupCompleted() && sync_set.Has(syncer::PASSWORDS); |
| 263 sync_set.Has(syncable::PASSWORDS); | |
| 264 } | 263 } |
| 265 | 264 |
| 266 bool password_manager_enabled = | 265 bool password_manager_enabled = |
| 267 tab_contents_->password_manager()->IsSavingEnabled(); | 266 tab_contents_->password_manager()->IsSavingEnabled(); |
| 268 | 267 |
| 269 Profile* profile = Profile::FromBrowserContext( | 268 Profile* profile = Profile::FromBrowserContext( |
| 270 web_contents()->GetBrowserContext()); | 269 web_contents()->GetBrowserContext()); |
| 271 bool preference_checked = | 270 bool preference_checked = |
| 272 profile->GetPrefs()->GetBoolean(prefs::kPasswordGenerationEnabled); | 271 profile->GetPrefs()->GetBoolean(prefs::kPasswordGenerationEnabled); |
| 273 | 272 |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1412 *profile_guid = IDToGUID(profile_id); | 1411 *profile_guid = IDToGUID(profile_id); |
| 1413 } | 1412 } |
| 1414 | 1413 |
| 1415 void AutofillManager::UpdateInitialInteractionTimestamp( | 1414 void AutofillManager::UpdateInitialInteractionTimestamp( |
| 1416 const TimeTicks& interaction_timestamp) { | 1415 const TimeTicks& interaction_timestamp) { |
| 1417 if (initial_interaction_timestamp_.is_null() || | 1416 if (initial_interaction_timestamp_.is_null() || |
| 1418 interaction_timestamp < initial_interaction_timestamp_) { | 1417 interaction_timestamp < initial_interaction_timestamp_) { |
| 1419 initial_interaction_timestamp_ = interaction_timestamp; | 1418 initial_interaction_timestamp_ = interaction_timestamp; |
| 1420 } | 1419 } |
| 1421 } | 1420 } |
| OLD | NEW |