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/native_backend_kwallet_x.h" | 5 #include "chrome/browser/password_manager/native_backend_kwallet_x.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 // Get the wallet name. | 381 // Get the wallet name. |
382 error = kwallet_dbus_.NetworkWallet(&wallet_name_); | 382 error = kwallet_dbus_.NetworkWallet(&wallet_name_); |
383 switch (error) { | 383 switch (error) { |
384 case KWalletDBus::Error::CANNOT_CONTACT: | 384 case KWalletDBus::Error::CANNOT_CONTACT: |
385 return TEMPORARY_FAIL; | 385 return TEMPORARY_FAIL; |
386 case KWalletDBus::Error::CANNOT_READ: | 386 case KWalletDBus::Error::CANNOT_READ: |
387 return PERMANENT_FAIL; | 387 return PERMANENT_FAIL; |
388 case KWalletDBus::Error::SUCCESS: | 388 case KWalletDBus::Error::SUCCESS: |
389 return INIT_SUCCESS; | 389 return INIT_SUCCESS; |
390 } | 390 } |
| 391 |
| 392 return PERMANENT_FAIL; |
391 } | 393 } |
392 | 394 |
393 password_manager::PasswordStoreChangeList NativeBackendKWallet::AddLogin( | 395 password_manager::PasswordStoreChangeList NativeBackendKWallet::AddLogin( |
394 const PasswordForm& form) { | 396 const PasswordForm& form) { |
395 int wallet_handle = WalletHandle(); | 397 int wallet_handle = WalletHandle(); |
396 if (wallet_handle == kInvalidKWalletHandle) | 398 if (wallet_handle == kInvalidKWalletHandle) |
397 return password_manager::PasswordStoreChangeList(); | 399 return password_manager::PasswordStoreChangeList(); |
398 | 400 |
399 ScopedVector<autofill::PasswordForm> forms; | 401 ScopedVector<autofill::PasswordForm> forms; |
400 if (!GetLoginsList(form.signon_realm, wallet_handle, &forms)) | 402 if (!GetLoginsList(form.signon_realm, wallet_handle, &forms)) |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 } | 825 } |
824 | 826 |
825 return handle; | 827 return handle; |
826 } | 828 } |
827 | 829 |
828 std::string NativeBackendKWallet::GetProfileSpecificFolderName() const { | 830 std::string NativeBackendKWallet::GetProfileSpecificFolderName() const { |
829 // Originally, the folder name was always just "Chrome Form Data". | 831 // Originally, the folder name was always just "Chrome Form Data". |
830 // Now we use it to distinguish passwords for different profiles. | 832 // Now we use it to distinguish passwords for different profiles. |
831 return base::StringPrintf("%s (%d)", kKWalletFolder, profile_id_); | 833 return base::StringPrintf("%s (%d)", kKWalletFolder, profile_id_); |
832 } | 834 } |
OLD | NEW |