| OLD | NEW |
| 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 // windows.h must be first otherwise Win8 SDK breaks. | 5 // windows.h must be first otherwise Win8 SDK breaks. |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #include <LM.h> | 7 #include <LM.h> |
| 8 #include <wincred.h> | 8 #include <wincred.h> |
| 9 | 9 |
| 10 // SECURITY_WIN32 must be defined in order to get | 10 // SECURITY_WIN32 must be defined in order to get |
| 11 // EXTENDED_NAME_FORMAT enumeration. | 11 // EXTENDED_NAME_FORMAT enumeration. |
| 12 #define SECURITY_WIN32 1 | 12 #define SECURITY_WIN32 1 |
| 13 #include <security.h> | 13 #include <security.h> |
| 14 #undef SECURITY_WIN32 | 14 #undef SECURITY_WIN32 |
| 15 | 15 |
| 16 #include "chrome/browser/password_manager/password_manager_util.h" | 16 #include "chrome/browser/password_manager/password_manager_util.h" |
| 17 | 17 |
| 18 #include "base/prefs/pref_registry_simple.h" | |
| 19 #include "base/prefs/pref_service.h" | 18 #include "base/prefs/pref_service.h" |
| 20 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 21 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 22 #include "base/win/windows_version.h" | 21 #include "base/win/windows_version.h" |
| 23 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
| 24 #include "chrome/grit/chromium_strings.h" | 23 #include "chrome/grit/chromium_strings.h" |
| 25 #include "components/password_manager/core/browser/password_manager.h" | 24 #include "components/password_manager/core/browser/password_manager.h" |
| 26 #include "components/password_manager/core/common/password_manager_pref_names.h" | 25 #include "components/password_manager/core/common/password_manager_pref_names.h" |
| 27 #include "content/public/browser/render_view_host.h" | 26 #include "content/public/browser/render_view_host.h" |
| 28 #include "content/public/browser/render_widget_host_view.h" | 27 #include "content/public/browser/render_widget_host_view.h" |
| 29 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
| 30 | 29 |
| 31 #if defined(USE_AURA) | 30 #if defined(USE_AURA) |
| 32 #include "ui/aura/window.h" | 31 #include "ui/aura/window.h" |
| 33 #include "ui/aura/window_tree_host.h" | 32 #include "ui/aura/window_tree_host.h" |
| 34 #endif | 33 #endif |
| 35 | 34 |
| 36 // static | |
| 37 void password_manager::PasswordManager::RegisterLocalPrefs( | |
| 38 PrefRegistrySimple* registry) { | |
| 39 registry->RegisterInt64Pref(password_manager::prefs::kOsPasswordLastChanged, | |
| 40 0); | |
| 41 registry->RegisterBooleanPref(password_manager::prefs::kOsPasswordBlank, | |
| 42 false); | |
| 43 } | |
| 44 | |
| 45 namespace password_manager_util { | 35 namespace password_manager_util { |
| 46 | 36 |
| 47 const unsigned kMaxPasswordRetries = 3; | 37 const unsigned kMaxPasswordRetries = 3; |
| 48 | 38 |
| 49 const unsigned kCredUiDefaultFlags = | 39 const unsigned kCredUiDefaultFlags = |
| 50 CREDUI_FLAGS_GENERIC_CREDENTIALS | | 40 CREDUI_FLAGS_GENERIC_CREDENTIALS | |
| 51 CREDUI_FLAGS_EXCLUDE_CERTIFICATES | | 41 CREDUI_FLAGS_EXCLUDE_CERTIFICATES | |
| 52 CREDUI_FLAGS_KEEP_USERNAME | | 42 CREDUI_FLAGS_KEEP_USERNAME | |
| 53 CREDUI_FLAGS_ALWAYS_SHOW_UI | | 43 CREDUI_FLAGS_ALWAYS_SHOW_UI | |
| 54 CREDUI_FLAGS_DO_NOT_PERSIST; | 44 CREDUI_FLAGS_DO_NOT_PERSIST; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 } | 235 } |
| 246 } | 236 } |
| 247 SecureZeroMemory(password, sizeof(password)); | 237 SecureZeroMemory(password, sizeof(password)); |
| 248 } | 238 } |
| 249 } while (credErr == NO_ERROR && | 239 } while (credErr == NO_ERROR && |
| 250 (retval == false && tries < kMaxPasswordRetries)); | 240 (retval == false && tries < kMaxPasswordRetries)); |
| 251 return retval; | 241 return retval; |
| 252 } | 242 } |
| 253 | 243 |
| 254 } // namespace password_manager_util | 244 } // namespace password_manager_util |
| OLD | NEW |