| 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/password_manager/password_manager.h" | 5 #include "chrome/browser/password_manager/password_manager.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/threading/platform_thread.h" | 8 #include "base/threading/platform_thread.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // a boolean histogram. | 50 // a boolean histogram. |
| 51 if (password_manager_enabled) | 51 if (password_manager_enabled) |
| 52 content::RecordAction(UserMetricsAction("PasswordManager_Enabled")); | 52 content::RecordAction(UserMetricsAction("PasswordManager_Enabled")); |
| 53 else | 53 else |
| 54 content::RecordAction(UserMetricsAction("PasswordManager_Disabled")); | 54 content::RecordAction(UserMetricsAction("PasswordManager_Disabled")); |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // anonymous namespace | 57 } // anonymous namespace |
| 58 | 58 |
| 59 // static | 59 // static |
| 60 void PasswordManager::RegisterUserPrefs(PrefService* prefs) { | 60 void PasswordManager::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
| 61 prefs->RegisterBooleanPref(prefs::kPasswordManagerEnabled, | 61 prefs->RegisterBooleanPref(prefs::kPasswordManagerEnabled, |
| 62 true, | 62 true, |
| 63 PrefService::SYNCABLE_PREF); | 63 PrefServiceSyncable::SYNCABLE_PREF); |
| 64 prefs->RegisterBooleanPref(prefs::kPasswordManagerAllowShowPasswords, | 64 prefs->RegisterBooleanPref(prefs::kPasswordManagerAllowShowPasswords, |
| 65 true, | 65 true, |
| 66 PrefService::UNSYNCABLE_PREF); | 66 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 67 } | 67 } |
| 68 | 68 |
| 69 // static | 69 // static |
| 70 void PasswordManager::CreateForWebContentsAndDelegate( | 70 void PasswordManager::CreateForWebContentsAndDelegate( |
| 71 content::WebContents* contents, | 71 content::WebContents* contents, |
| 72 PasswordManagerDelegate* delegate) { | 72 PasswordManagerDelegate* delegate) { |
| 73 if (FromWebContents(contents)) { | 73 if (FromWebContents(contents)) { |
| 74 DCHECK_EQ(delegate, FromWebContents(contents)->delegate_); | 74 DCHECK_EQ(delegate, FromWebContents(contents)->delegate_); |
| 75 return; | 75 return; |
| 76 } | 76 } |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 delegate_->FillPasswordForm(fill_data); | 313 delegate_->FillPasswordForm(fill_data); |
| 314 return; | 314 return; |
| 315 } | 315 } |
| 316 default: | 316 default: |
| 317 if (observer_) { | 317 if (observer_) { |
| 318 observer_->OnAutofillDataAvailable(preferred_match.username_value, | 318 observer_->OnAutofillDataAvailable(preferred_match.username_value, |
| 319 preferred_match.password_value); | 319 preferred_match.password_value); |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 } | 322 } |
| OLD | NEW |