| 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_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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 397 |
| 398 void GKRMethod::RemoveLogin(const PasswordForm& form, const char* app_string) { | 398 void GKRMethod::RemoveLogin(const PasswordForm& form, const char* app_string) { |
| 399 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 399 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 400 // We find forms using the same fields as LoginDatabase::RemoveLogin(). | 400 // We find forms using the same fields as LoginDatabase::RemoveLogin(). |
| 401 gnome_keyring_delete_password( | 401 gnome_keyring_delete_password( |
| 402 &kGnomeSchema, | 402 &kGnomeSchema, |
| 403 OnOperationDone, | 403 OnOperationDone, |
| 404 this, // data | 404 this, // data |
| 405 NULL, // destroy_data | 405 NULL, // destroy_data |
| 406 "origin_url", form.origin.spec().c_str(), | 406 "origin_url", form.origin.spec().c_str(), |
| 407 "action_url", form.action.spec().c_str(), | |
| 408 "username_element", UTF16ToUTF8(form.username_element).c_str(), | 407 "username_element", UTF16ToUTF8(form.username_element).c_str(), |
| 409 "username_value", UTF16ToUTF8(form.username_value).c_str(), | 408 "username_value", UTF16ToUTF8(form.username_value).c_str(), |
| 410 "password_element", UTF16ToUTF8(form.password_element).c_str(), | 409 "password_element", UTF16ToUTF8(form.password_element).c_str(), |
| 411 "submit_element", UTF16ToUTF8(form.submit_element).c_str(), | 410 "submit_element", UTF16ToUTF8(form.submit_element).c_str(), |
| 412 "signon_realm", form.signon_realm.c_str(), | 411 "signon_realm", form.signon_realm.c_str(), |
| 413 "application", app_string, | 412 "application", app_string, |
| 414 NULL); | 413 NULL); |
| 415 } | 414 } |
| 416 | 415 |
| 417 void GKRMethod::GetLogins(const PasswordForm& form, const char* app_string) { | 416 void GKRMethod::GetLogins(const PasswordForm& form, const char* app_string) { |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 } | 786 } |
| 788 return ok; | 787 return ok; |
| 789 } | 788 } |
| 790 | 789 |
| 791 std::string NativeBackendGnome::GetProfileSpecificAppString() const { | 790 std::string NativeBackendGnome::GetProfileSpecificAppString() const { |
| 792 // Originally, the application string was always just "chrome" and used only | 791 // Originally, the application string was always just "chrome" and used only |
| 793 // so that we had *something* to search for since GNOME Keyring won't search | 792 // so that we had *something* to search for since GNOME Keyring won't search |
| 794 // for nothing. Now we use it to distinguish passwords for different profiles. | 793 // for nothing. Now we use it to distinguish passwords for different profiles. |
| 795 return base::StringPrintf("%s-%d", kGnomeKeyringAppString, profile_id_); | 794 return base::StringPrintf("%s-%d", kGnomeKeyringAppString, profile_id_); |
| 796 } | 795 } |
| OLD | NEW |