| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_gnome_x.h" | 5 #include "chrome/browser/password_manager/native_backend_gnome_x.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <gnome-keyring.h> | 8 #include <gnome-keyring.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 method->forms_.clear(); | 409 method->forms_.clear(); |
| 410 // |list| will be freed after this callback returns, so convert it now. | 410 // |list| will be freed after this callback returns, so convert it now. |
| 411 ConvertFormList(list, &method->forms_); | 411 ConvertFormList(list, &method->forms_); |
| 412 method->event_.Signal(); | 412 method->event_.Signal(); |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace | 415 } // namespace |
| 416 | 416 |
| 417 NativeBackendGnome::NativeBackendGnome(LocalProfileId id, PrefService* prefs) | 417 NativeBackendGnome::NativeBackendGnome(LocalProfileId id, PrefService* prefs) |
| 418 : profile_id_(id), prefs_(prefs) { | 418 : profile_id_(id), prefs_(prefs) { |
| 419 if (PasswordStoreX::PasswordsUseLocalProfileId(prefs)) { | 419 // TODO(mdm): after a few more releases, remove the code which is now dead due |
| 420 // to the true || here, and simplify this code. We don't do it yet to make it |
| 421 // easier to revert if necessary. |
| 422 if (true || PasswordStoreX::PasswordsUseLocalProfileId(prefs)) { |
| 420 app_string_ = GetProfileSpecificAppString(); | 423 app_string_ = GetProfileSpecificAppString(); |
| 421 // We already did the migration previously. Don't try again. | 424 // We already did the migration previously. Don't try again. |
| 422 migrate_tried_ = true; | 425 migrate_tried_ = true; |
| 423 } else { | 426 } else { |
| 424 app_string_ = kGnomeKeyringAppString; | 427 app_string_ = kGnomeKeyringAppString; |
| 425 migrate_tried_ = false; | 428 migrate_tried_ = false; |
| 426 } | 429 } |
| 427 } | 430 } |
| 428 | 431 |
| 429 NativeBackendGnome::~NativeBackendGnome() { | 432 NativeBackendGnome::~NativeBackendGnome() { |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 // Each other profile must be able to migrate the shared data as well, | 731 // Each other profile must be able to migrate the shared data as well, |
| 729 // so we must leave it alone. After a few releases, we'll add code to | 732 // so we must leave it alone. After a few releases, we'll add code to |
| 730 // delete them, and eventually remove this migration code. | 733 // delete them, and eventually remove this migration code. |
| 731 // TODO(mdm): follow through with the plan above. | 734 // TODO(mdm): follow through with the plan above. |
| 732 PasswordStoreX::SetPasswordsUseLocalProfileId(prefs_); | 735 PasswordStoreX::SetPasswordsUseLocalProfileId(prefs_); |
| 733 } else { | 736 } else { |
| 734 // We failed to migrate for some reason. Use the old app string. | 737 // We failed to migrate for some reason. Use the old app string. |
| 735 app_string_ = kGnomeKeyringAppString; | 738 app_string_ = kGnomeKeyringAppString; |
| 736 } | 739 } |
| 737 } | 740 } |
| OLD | NEW |